Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I shutdown an active server instance?

I would like to know how to shutdown a specific Roblox server using scripting.

1 comment

0

I dont think this is possible

1 answer

✓ Accepted answer
for x = 1,15,1 do --make it constantly kick whoever rejoins for 15 seconds to ensure that nobody else is inside the server. You don't have to do this but its more safe. Correct me if i'm wrong or if there is a more efficient method
    for i, v in pairs(game.Players:GetPlayers()) do
        wait()
        v:Kick("server shutdown")
    end
    wait(1)
    if #(game.Players:GetPlayers()) == 0 then break end --Again, not needed, but I like to add it in
end

Actually, you can just do this, however there is a risk of players rejoining the server or new players joining causing the server to not actually shut down

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

This discussion is preserved as it was. New answers, comments, and votes are closed.