Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Linked sword invisible Kill Effect not working can someone help?

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

This discussion is preserved as it was. New answers, comments, and votes are closed.