Best method of shutting down a game

To shutdown I game, I currently :kick() every player from the game. This is not 100% effective though because if players rejoin quickly, the server won’t shutdown.

My question is: what is the most effective way to shutdown a server, which stops any possibility of players rejoining again?

12 Likes

One in a lot of duplicates… (use the search feature)

https://devforum.roblox.com/t/how-to-shutdown-a-game-correctly/20803/9
https://devforum.roblox.com/t/shut-down-server-by-script/575
https://devforum.roblox.com/t/will-this-shut-down-a-server-properly/10075
https://devforum.roblox.com/t/how-2-properly-shutdown-a-server-from-within/10305/5

This is the best one: Soft Shutdown Script

Edit: so you’re a basic user and you don’t have access to this stuff. GG.

10 Likes

Unfortunately yep. What method was used in ‘the best one’ you referred to?

2 Likes

That is a soft shutdown script. I don’t think it’s what you’re looking for - it seems like you are trying to shut down the server from in-game. The soft shutdown script works when you press the ‘shut down all servers’ button on the roblox webpage.

I would use one of the other posts that he posted, maybe the 2nd one

4 Likes

I can’t see any of those posts:

3 Likes

Alright here you go, here’s a script I found in one of the posts. It’s basically the same as what byc14 posted earlier.

function shutdown()
game.Players.ChildAdded:connect(function(h)
h:Kick()
end)
for _,i in pairs (game.Players:GetChildren()) do
i:Kick()
end
end

13 Likes

Thanks - this seems like the best approach

1 Like