I have a part that is in the player that I want to damage other players if they come in contact with it without ever hurting the player. So I made this script for it but as it doesn't damage the main payer, it doesn't damage any players at all for some reason. Any help? And it's in a normal script, just in case that's causing the problem.
local player = script.Parent.Parent
local nameL = player.Name
local blast = script.Parent
blast.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Name ~= nameL then
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health-50
end
end
end)

7 comments
Does Anyone like The answer I gave? If you do please Accept this answer lol! Im not used to getting accepted X:D!
You spelled Humanoid wrong but I'll accept it.
oh ok im sorry lol
Its not working??? my Script? What is the Error?
Its not working??? my Script? What is the Error?
I still don't know myself how to find the local player through a normal script and that's the error script.Parent.Parent gives me.
you simply can't do that