Ad
Log in to vote
0

Linked sword invisible Kill Effect not working can someone help?

Asked by
Nixlex 0
1 day ago

I am new to scripting and have attempted to make a kill effect for the linked sword. This is what I have come up with:

character:FindFirstChild("Humanoid").Health <= 0 then
        script.Parent.Humanoid.Died:connect(function(Plr)
            for i, v in pairs(workspace:WaitForChild(script.Parent.Name):GetChildren())do
                if v:IsA("Accessory") then
                    v.Handle.Anchored = true
                elseif v:IsA("MeshPart") then
                    v.Anchored = true
                elseif v:IsA("UnionOperation") then
                    v.Anchored = true
                elseif v:IsA("Part") then
                    v.Anchored = true
                end
            end
            for i = 1,20 do
                wait(0.0025)
                for i, v in pairs(workspace:WaitForChild(script.Parent.Name):GetChildren())do
                    if v:IsA("Accessory") then
                        v.Handle.Transparency = v.Handle.Transparency + 0.05
                    elseif v.Name == "Head" then
                        v.Transparency = v.Transparency + 0.05
                        v.face.Transparency = v.face.Transparency + 0.05
                    elseif v:IsA("MeshPart") then
                        v.Transparency = v.Transparency + 0.05
                    elseif v:IsA("UnionOperation") then
                        v.Transparency = v.Transparency + 0.05
                    elseif v:IsA("Part") then
                        v.Transparency = v.Transparency + 0.05
                    end
                end
            end
        end)

I have put this in the SwordScript underneath:

local character = Hit.Parent
    if character == Character then
        return
    end

Can someone please explain what I have done wrong.

1 answer

Log in to vote
0
Answered by 1 day ago

There Is a Humanoid event called .Died()

More Information can be seen here:

https://developer.roblox.com/en-us/api-reference/event/Humanoid/Died

0
Could you maybe elaborate on it a little more? Nixlex 0 — 1d
Ad

Answer this question