generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Game shutdown on death

Previous Thread :: Next Thread 
cricklycoral is not online. cricklycoral
Joined: 22 Nov 2015
Total Posts: 2047
27 Dec 2015 12:28 PM
You know in misterobvious's YOLO obby, where once you die, the game shutsdown? I want a script that does that. Please help
Report Abuse
verbalAKspray is not online. verbalAKspray
Joined: 09 Jul 2014
Total Posts: 23685
27 Dec 2015 12:30 PM
player:kick()


im almighty salsa blackman R$14,132 Tx26,495
Report Abuse
cricklycoral is not online. cricklycoral
Joined: 22 Nov 2015
Total Posts: 2047
27 Dec 2015 12:38 PM
Are you sure that will work if the player dies?
Report Abuse
GRAGGER2001 is not online. GRAGGER2001
Joined: 05 Apr 2009
Total Posts: 2043
27 Dec 2015 12:40 PM
player = game:GetService("Players").LocalPlayer

player.Character.Humanoid.Changed:connect(function()
if player.Character.Humanoid.Health == 0 then
player:Kick("You died")
end
end)
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
27 Dec 2015 12:46 PM
kick doesn't disconnect when called from client
Report Abuse
GRAGGER2001 is not online. GRAGGER2001
Joined: 05 Apr 2009
Total Posts: 2043
27 Dec 2015 12:47 PM
True...
Report Abuse
GRAGGER2001 is not online. GRAGGER2001
Joined: 05 Apr 2009
Total Posts: 2043
27 Dec 2015 12:48 PM
-- put this script in StarterGui or StarterGear
player = script.Parent.Parent

player.Character.Humanoid.Changed:connect(function()
if player.Character.Humanoid.Health == 0 then
player:Kick("You died")
end
end)
Report Abuse
cricklycoral is not online. cricklycoral
Joined: 22 Nov 2015
Total Posts: 2047
27 Dec 2015 12:50 PM
Thank you!
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
27 Dec 2015 12:53 PM
why would you ever want to run server scripts inside players, makes no sense

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(char)
char.Humanoid.Died:connect(function()
p:Kick()
end)
end)
end)
Report Abuse
GRAGGER2001 is not online. GRAGGER2001
Joined: 05 Apr 2009
Total Posts: 2043
27 Dec 2015 01:02 PM
I woke up an hour ago. I'm not functioning right yet. But hey! If it works it works!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image