The part with the damage script in it is in Lighting. Using a script in a tool I clone it into workspace, but it hurts me, the person who cloned it. How can I make it not hurt whoever summoned the clone? I've tried all kinds of crazy things to no avail.
hurt = true
function touch(hit)
if hurt == true then
humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid").Health -30
hurt = false
wait (0.1)
hurt = true
end
end
end
script.Parent.Touched:connect(touch)

2 comments
The tool is part of the character, but the projectile is part of workspace.
You could always parent the projectile to the character?