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
 

Re: easy way to shut down server?

Previous Thread :: Next Thread 
trillmug78 is not online. trillmug78
Joined: 22 Dec 2014
Total Posts: 9283
29 Apr 2015 06:15 PM
i tried a couple but they don't work

i need an adequate signature
Report Abuse
verbalAKspray is not online. verbalAKspray
Joined: 09 Jul 2014
Total Posts: 23685
29 Apr 2015 06:24 PM
kick all players

and maybe kick every player that joins
Report Abuse
trillmug78 is not online. trillmug78
Joined: 22 Dec 2014
Total Posts: 9283
29 Apr 2015 06:24 PM
b

i need an adequate signature
Report Abuse
025110 is not online. 025110
Joined: 23 Nov 2012
Total Posts: 57661
29 Apr 2015 06:25 PM
for i,v in pairs(game.Players:GetChildren()) do
v:Kick()
end
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
29 Apr 2015 06:31 PM
Kicking the players could work, or you could just clear all children for an easy one line code :)
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
29 Apr 2015 06:36 PM
@cody
ClearAllChildren does not disconnect the client.

for i,v in next,game.Players:GetPlayers() do
v:Kick()
end
Report Abuse
trillmug78 is not online. trillmug78
Joined: 22 Dec 2014
Total Posts: 9283
29 Apr 2015 06:43 PM
ok thanks, i tested it a couple of times and it worked :)

i need an adequate signature
Report Abuse
SummerEquinox is not online. SummerEquinox
Joined: 25 Jun 2013
Total Posts: 2088
29 Apr 2015 06:59 PM
Or you could crash it.

repeat
print 'SlowingGame'
print 'Crashing'
until nil



Nothing is impossible, the word itself says 'Im possible'
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
29 Apr 2015 07:03 PM
@Summer
That will not slow the server at all. The script will simply crash.
Report Abuse
SummerEquinox is not online. SummerEquinox
Joined: 25 Jun 2013
Total Posts: 2088
29 Apr 2015 07:04 PM
Ah, ok, thanks.


Nothing is impossible, the word itself says 'Im possible'
Report Abuse
Froast is not online. Froast
Joined: 12 Mar 2009
Total Posts: 3134
29 Apr 2015 07:42 PM
local kick = function(plr)
plr:Kick()
end

for _,plr in next, game.Players:GetPlayers() do
kick(plr)
end
game.Players.PlayerAdded:connect(kick)
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
30 Apr 2015 11:04 PM
@froast more work than needed
@above Never said it had to be efficient
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
30 Apr 2015 11:43 PM
The server might not shut down just by kicking everyone, because what if someone is joining while you kick ro whatever
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
30 Apr 2015 11:56 PM
local isServerShutDown = false

for i, v in pairs(game.Players:GetPlayers()) do
v:Kick()
end

isServerShutDown = true

game.Players.PlayerAdded:connect(function(plr)
if isServerShutDown then
plr:Kick()
end
end)
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
01 May 2015 12:02 AM
eh well actually

local isServerShutDown = false

function shutDown(playersToKick)
for i, v in pairs(playersToKick) do
v:Kick()
end
isServerShutDown = true
end

-- whenever you want to shut down the server, call that function

shutDown(game.Players:GetPlayers())

-- and to account for new players joining after the server is cleared out, add this playeradded function

function plrAdded(plr)
if isServerShutDown then
plr:Kick()
end
end

game.Players.PlayerAdded:connect(plrAdded)

Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
01 May 2015 12:03 AM
kick all players, run a loop to kick anyone who enters after that, open a new thread with a loop that has no yield and you're golden

-=Robo=-
Report Abuse
w8t is not online. w8t
Joined: 01 Mar 2012
Total Posts: 560
01 May 2015 04:31 AM
Crash the server:

local s=Instance.new('Sound',workspace)
s.SoundId='http://roblox.com/asset?id=83594623'
s:Play()
Report Abuse
Klocko is not online. Klocko
Joined: 10 May 2011
Total Posts: 428
01 May 2015 04:39 AM
^ That doesn't even crash the server, all it does is crash players on Windows.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
01 May 2015 04:54 AM
function ShutItDown()
game.OnClose = function()
for i,v in pairs(game:GetChildren()) do
if not v:IsA("Players") then
for i,v in pairs(v:GetChildren()) do
pcall(function() if not v == script then v:Destroy() end end)
end
end
end
end
game.Players.PlayerAdded:connect(function(p)
p:Kick()
end)
for i,v in pairs(game.Players:GetPlayers()) do
v:Kick()
end
end

ShutItDown()
--This should work :)
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
02 May 2015 07:27 PM
@cnt
Again, efficiency isn't what I was going for.
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
02 May 2015 08:28 PM
while wait() do for i,v in next, game.Players:GetPlayers() do v:Kick() end end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 May 2015 08:50 PM
'Again, efficiency isn't what I was going for.'
What are you talking about, I wasn't referring to you when I said what I said nor was I ever talking about efficiency silly.
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