Shutting the server down problem

Hi!, I’ve been trying to find a better solution of shutting down a server other than just

for _,Player in pairs(game.Players:GetPlayers()) do
   Player:Kick("Manual shutdown")
end

game.Players.PlayerAdded:Connect(function(Player)
   Player:Kick("Manual shutdown")
end)

because said code above seems to have a problem where whenever the manual shutdown occur by using that code, certain players will still be able to join the said server resulting in infinite loading. I’ve also tried to combine Soft shutdown script made by Merely

with the manual shutdown but I’ve reach the rock bottom of not being able to figuring anything out.

If your intention is to turn off all servers, within the place in the dots you have the option:

1 Like

The Soft Shutdown Script by Merely works perfectly for me.
You can attempt to use another script.

1 Like

The point of manual script I have is to shutdown the server that has reach it’s age limit in order to prevent high memory server from existing.

Interesting… I’ll definitely look into that thanks!