I have a basic damage script that does damage to any humanoid. I want to make it deal damage only to the player, meaning any other humanoids such as npcs would not be affected.
script.Parent.Touched:connect(function(hit)
pcall(function()
hit.Parent.Humanoid:TakeDamage(10)
end)
end)
I haven't been able to find anything like this, I don't know if it's actually possible. Does anyone have any ideas?
Thanks.

2 comments
Idk this seems less simple in 3 ways.... But okay
Well yeah, my point was instead of making a for loop for utterly no reason, use a built in function. Thats all. I'll edit it to say that.