#I need help with the death effect module.

1 messages · Page 1 of 1 (latest)

dusky slate
#

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
cloud kestrel
#

hi

#

i will try help!

#

local IceExplosionEffect = {}

function IceExplosionEffect.play(character, damageToApply, attackerPlayer)
local CHAR_COLOR = Color3.fromRGB(134, 249, 255)
local CHAR_MATERIAL = Enum.Material.Ice
local ICE_TEXTURE_ID = "rbxassetid://104778768"

local function applyIceToPart(part)
    -- Apply color and material
    part.Color = CHAR_COLOR
    part.Material = CHAR_MATERIAL


    local sa = part:FindFirstChildOfClass("SurfaceAppearance")
    if not sa then
        sa = Instance.new("SurfaceAppearance")
        sa.Parent = part
    end
    sa.ColorMap = ICE_TEXTURE_ID
    sa.NormalMap = "" -- optional: add normal map for better effect
    sa.MetalnessMap = ""
    sa.RoughnessMap = ""
end

local function applyIceToDecal(decal)
    decal.Texture = ICE_TEXTURE_ID
end

for _, descendant in ipairs(character:GetDescendants()) do
    if descendant:IsA("MeshPart") or descendant:IsA("Part") then
        if descendant.Name ~= "HumanoidRootPart" then
            applyIceToPart(descendant)
        end
    elseif descendant:IsA("Decal") then
        applyIceToDecal(descendant)
    elseif descendant:IsA("Accessory") then
        local handle = descendant:FindFirstChild("Handle")
        if handle then
            applyIceToPart(handle)
            -- Change any decals on the handle
            for _, d in ipairs(handle:GetDescendants()) do
                if d:IsA("Decal") then
                    applyIceToDecal(d)
                end
            end
        end
    elseif descendant:IsA("Shirt") then
        descendant.ShirtTemplate = ICE_TEXTURE_ID
    elseif descendant:IsA("Pants") then
        descendant.PantsTemplate = ICE_TEXTURE_ID
    elseif descendant:IsA("ShirtGraphic") then
        descendant.Graphic = ICE_TEXTURE_ID
    end
end

end

return IceExplosionEffect

#

@dusky slate

#

try it!

#

if it not working im suck at it Thumbs

dusky slate
cloud kestrel
#

sorry

rich canyonBOT
#

studio** You are now Level 3! **studio

cloud kestrel
#

i was trying to do smth

#

but im js suck