HI, am trying to make a script that clones a script into a player that has touched a hitbox. Here is the script:
local u = false
script.Parent.Touched:connect(function(part)
if not u then
u = true
if part.Parent then
local human = part.Parent:FindFirstChild("Humanoid")
game.ReplicatedStorage.ElectShock:Clone().Parent = human.Parent
end
wait (6)
u = false
end
end)
It works in paper, but when I test it, I get an error: Workspace.Electt.slowDamage:7: attempt to index nil with ‘Parent’
well I don’t know why, but some times it works some times it doesn’t.