How do i kill the player using ClickDetector?
So ive been trying to make a part kill you using clickdetector by myself first, but all my attempts were unusuccesful
01 | local players = game:GetService( "Players" ) |
02 | local ClickDetector = game.Workspace.clickpart.ClickDetector |
03 | local clickpart = script.Parent |
05 | clickpart.ClickDetector.MouseClick:Connect( function (hit) |
06 | local player = players:GetPlayerFromCharacter(hit.Parent) |
08 | local humanoid = hit.Parent:FindFirstChildWhichIsA( "Humanoid" ) |
10 | if humanoid.Health > 0 then |