Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make a kill player script? [closed]

Asked by 5 years ago

how do make a kill player script?

0
script.Parent:Destroy() wait(5) game.Workspace.Union:Destroy() flamingrobot1 -5 — 5y
0
^ what? Psudar 882 — 5y

Closed as Too Broad by TheeDeathCaster

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
Psudar 882 Moderation Voter
5 years ago

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.

lua --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) https://developer.roblox.com/api-reference/class/Humanoid

Ad