wanted to understand the use of it to try to find out which player did the event so that I can create a text that appears on the correct screen) in short, I want to understand the use of 'hit' script:
function onTouched(hit)
if hit.Parent:findFirstChild("Humanoid") then
hit.Parent.Humanoid:TakeDamage(100)
end
end
script.Parent.Touched:connect(onTouched)
this script can find out which player played a part so that it kills it ... and not another player that didn't even come close. I wanted to understand how

3 comments
interesting,but is it really necessary to put 3 conditions in the if like you did?
No, I wouldn't
I really tested it and it works, but there are many errors ... after I put the 3 conditions the errors disappeared and everything worked correctly ... I just wanted to understand how these three conditions work?