What is wrong with this script? I want it to kill the player who clicks it. I put this on a script inside of the click detector.
script.Parent.MouseClick:Connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid') then
hit.Parent:FindFirstChild('Humanoid').Health = 0
end
end)

3 comments
I thought that MouseClick passed the mouse?
Nope! https://developer.roblox.com/api-reference/class/ClickDetector you can see it under events, passes the player
Thanks, it worked.