Any way of using game:Shutdown() with admins permission?

Hello there!, im trying to make my own kick gui so whenever the player presses leave it will take them straight out of the game without the kick message.

I found a function called game:Shutdown() but when i used it. It said current identity 3 permission whatever. Yes i know it has to be written in a core script but could possibly get admin permission to do this?

You can just kick all of the players from the game to “Shutdown” the game. Then just kick anyone who tries to join too, to make sure it closes.

local PlayersService = game:GetService("Players")

local Players = PlayersService:GetPlayers()

for _, Player in pairs(Players) do


Due to the security of this function, this cannot be used

You can either

  1. Kick all players in the game (using the solution above)
  2. Set the parent of all Player instances to nil

This won’t even work by the way

That’s not my question. I said if i could do something where when a player presses leave from my own GUI it will take them straight out of the game.

I’ve tested this before and it still works. It’ll do code 275

You can’t kick player’s without saying they’ve been kicked.

Try crashing them instead, but that can lead to dissatisfaction with the game.

1 Like


You just can’t. You need identity 3 which is not happening. If you want the security required for DataModel:Shutdown to be lower make a feature request.

(to OP ofc)

1 Like

Didn’t work for me. It just makes me invisible. Didn’t get kicked from the game.

Likely because your in Studio. This is something roblox’s servers do if no players are detected in a game

I think that game:Shutdown() is used by the core scripts internally to shutdown playerless servers, therefore, it cannot be used by game scripts


Any lua code you run is contained within the Roblox client, so I don’t think you can close the window from a local script. You can only kick the player, and they would still have to manually close out of the window themselves. If you don’t want a “You were kicked.” message to appear to the player then just call :Destroy() on the player object. It will disable the player however they will still see the map until they exit the window or the server shuts down.

As everyone else said, the only viable solution would probably to kick everyone out. Unfortunately, it will still display the kick message, though there is a parameter that allows you to add message with it.

Essentially you just want to loop through all the players and just kick them out one by one.

for i,Player in pairs(game:GetService("Players"):GetPlayers()) do
    Player:Kick("This server has been shutdown by an administrator.")

This is probably because you’re the only player in the server?

It shutdowns if the player count is 0, doesn’t matter how many were already in the server