On the press of a key it clones from lighting to the players character, and changes a string value in the clone to the the players name. With ~= it doesn't hurt the player who presses the key, but it also doesn't hurt anything else. If I change it to == it hurts the character, but also hurts anything else. Why is this? Shouldn't it only not hurt someone with the name of the string's value?
Also, if anyone knows a way to make it so that the clone can't hurt the person who cloned it, I'd appreciate it if you shared.
humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid and script.Parent.Parent.Name ~= script.Parent.owner.Value then --script.Parent.Parent = Character
hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid").Health -7

1 comment
Thanks