The problem I'm having is that I can't get my module to cover the entire player's avatar. I mean, I want to change all of its texture, color, etc. to just one, but it doesn't work. Some parts are left black, or it simply doesn't appear on some accessories. Could you help me by telling me what I'm missing? This is my module:
local IceExplosionEffect = {}
function IceExplosionEffect.play(character, damageToApply, attackerPlayer)
print("iniciador freeze")
local CHAR_COLOR = Color3.fromRGB(134, 249, 255)
local CHAR_MATERIAL = Enum.Material.Ice
local ICE_TEXTURE_ID = "rbxassetid://104778768"
local SSG = game:GetService("ServerStorage")
local DeathEffectsVfx = SSG:WaitForChild("DeathEffectsVfx")
local BurnFolder = DeathEffectsVfx:WaitForChild("BasicFreezeVfx")
local burnVfx = BurnFolder:WaitForChild("freezevfx")
local vfx = burnVfx:WaitForChild("freeze")
local rootPart = character:FindFirstChild("Torso")
if not rootPart then return end
local clonevfx = vfx:Clone()
clonevfx.Parent = rootPart
local function getOrCreateSurfaceAppearance(part)
local sa = part:FindFirstChildOfClass("SurfaceAppearance")
if not sa then
sa = Instance.new("SurfaceAppearance")
sa.Parent = part
end
return sa
end
for _, descendant in ipairs(character:GetDescendants()) do
if descendant:IsA("MeshPart") then
local sa = getOrCreateSurfaceAppearance(descendant)
sa.ColorMap = ICE_TEXTURE_ID
sa.NormalMap = ""
sa.MetalnessMap = ""
sa.RoughnessMap = ""
elseif descendant:IsA("Part") and descendant.Name ~= "HumanoidRootPart" then
descendant.Color = CHAR_COLOR
descendant.Material = CHAR_MATERIAL
elseif descendant:IsA("Decal") and descendant.Name == "face" then
descendant.Texture = ICE_TEXTURE_ID
end
end
end
return IceExplosionEffect

** You are now Level 3! **