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

How to make your game kick a player when they die? [closed]

Asked by
Skyyrn 1
4 years ago

For my game, I need a kick-on-death script that has a GUI at the end that says "You died" and whatnot. The thing is I'm not a scripter and I can't find tutorials anywhere. I've found a Death then Kick script in the ROBLOX Library, but it doesn't work. Can someone paste the script for me and explain how to make the GUI?

Closed as Not Constructive by matiss112233 and Ziffixture

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
-1
Answered by 4 years ago
Edited 4 years ago

So You Could Use A Script In Starter Player Scripts That Will Check To See If They Have 0 Health Then Kick Them.

  • Make A Local Script And Put It In StarterPlayerScripts

Now Put This Code Into The Local Script.

local plr = game.Players.LocalPlayer
function kick(reason)
plr:Kick(reason)
end
while wait() do
if not plr.Character then
-- They Are Probably Exploiting or There Character Is = Nil/Null --
kick("Do Not Exploit!")
else
if not plr.Character:FindFirstChild("Humanoid") then
kick("Do Not Exploit!")
else
if plr.Character.Humanoid.Health == 0 then
kick("You Died :(") -- Kick them If they have died -- You can put a custom message inside the speech marks! --
else
-- They Haven't Died --
end
end
end
end

If You Still Need Help You Can Contact Me On Twitter @harry_theking1 Or On Discord: Harry_TheKing1#2303

Ad