So basically, I've been making this attack script and I really need this damage thing to work, here's what I got right now, it's meant to work but doesn't. Can anyone please hint out the mistake?
part.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
if hit.Parent.Name ~= Player.Name then
hit.Parent.Humanoid:TakeDamage(math.huge)
end
end
end)

3 comments
I don't get it. Why do people keep complaining about using :connect or :Connect? It's a RBXSignal, what diffirences are there between those two?
None. One's deprecated. Not really an issue.
I don't think I've rephrased this properly, basically the original script was meant to kill others and not myself, plus the script that I'm using is for script builder so I can't do it like that. Also, the script works on a part that's not touching me so I think the problem is that it's only getting my name and no one else because it spawns from me