I think your script it's outdated so it didn't work for you.
Scripts that kill players were easy to do. So, let figure out how it works.
script.Parent.Touched:Connect(function(hit)
end)
Function 'hit' is a neutral function, so if the script's parent touched this will connect function 'hit'.
'end)' is a thing that automatically adds while your connect's bracket has a function.
script.Parent.Touched:Connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
end
end)
Line 2 means if 'hit' and the parent (People) who touched and find a thing named 'Humanoid'.
'end' is used for ends the if...then statement.
script.Parent.Touched:Connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = 0
end
end)
Line 3 shows the people who touched will get the humanoid and make the health become 0.
I hope I helped, and thanks for reading patiently! I hope you have a nice day :D, bye!
1 comment
^