how do make a kill player script?
COMMUNITY QUESTION
How do i make a kill player script?
1 answer
You can use the Humanoid to access the health of the player, and then change that to zero. This is just an example event firing the function, and it could run in any type of way.
--scripts parent is a brick
script.Parent.Touched:Connect(function(hit) --when brick is touched connect a function and give it the argument hit, which is whatever touched it.
if hit.Parent:FindFirstChild("Humanoid")then --if hit contains a humanoid (like a character of the player) then
hit.Parent.Humanoid.Health = 0 --set the health of that humanoid to 0, killing them
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
script.Parent:Destroy() wait(5) game.Workspace.Union:Destroy()
^ what?