|
| 27 Jul 2015 06:22 AM |
| Does anyone know how to create a script to shutdown the game / Crash |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2015 06:24 AM |
| You can kick all the players. There is no official shutdown command. |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2015 06:57 AM |
Here are some ways.
LocalScript:
local function Shutdown() while true do end end
Shutdown()
Another one, this time ServerScript:
local function Shutdown() while true do end end
Shutdown()
Yet another one, this is still ServerScript:
local function Shutdown() for Player = 1, #game.Players:GetPlayers() do game.Players:GetPlayers()[Player]:Kick("This game has shutdown.") end end
Shutdown()
There are some more, but these are most common, I think. :P
|
|
|
| Report Abuse |
|
|
Froast
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 3134 |
|
|
| 27 Jul 2015 07:38 AM |
local kick = function(plr) plr:Kick() end local players = game:GetService'Players' players.PlayerAdded:connect(kick) for _,plr in next, players:GetPlayers() do kick(plr) end |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2015 11:08 AM |
| U proved Cody Wrong, Thanks. |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 27 Jul 2015 11:10 AM |
for i, v in next, game:Players:GetPlayers() do v:Kick() end
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 27 Jul 2015 11:13 AM |
@Dark Thank you for providing the perfect and cleanest example that I would have otherwise typed out. Thank you.
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2015 11:14 AM |
No one mentioned a 'crash' except for me. I win. :P I did both.
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|
Froast
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 3134 |
|
|
| 27 Jul 2015 11:24 AM |
Dark's version is flawed as a player could join in the short time before the server closes from lack of players.
Also, this is 2015, there is no reason to crash players... |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 27 Jul 2015 11:26 AM |
| @power, you cannot crash plrs. |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2015 11:34 AM |
while true do end
Player:Destroy()
But you aren't allowed to crash players, it's against the rules of ROBLOX.
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2015 11:58 AM |
| Dark, Nice clean one, I should use that instead. |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2015 12:00 PM |
| not sure if it works anymore but game.Lighting:destroy() was nice. |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2015 12:02 PM |
@ty
Can you please reference that to the TOS page? pls
Thx ;3 |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2015 12:05 PM |
@texastyaust
That no longer works, Output just says its locked. |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 27 Jul 2015 09:08 PM |
A simple idiotic mistake was discovered:
for i, v in next, game.Players:GetPlayers() do v:Kick() end
Before:
game:Players:GetPlayers()
After:
game.Players:GetPlayers()
Simple mistakes are so annoying! ;D |
|
|
| Report Abuse |
|
|