So uh,i wanted to make so that when the game is about to be shutdowned,the players would be teleported to a place that teleports them back to the game,but for some reason it doesnt teleport and it just shutdowns,how can i make it teleport every player before shutdowning the server?
Here’s the script:
local tps = game:GetService("TeleportService")
local PlaceId = 10635465338
game:BindToClose(function()
for i, player in pairs(game.Players:GetPlayers()) do
player.PlayerGui.Shutdown.Enabled = true
end
local tpOptions = Instance.new("TeleportOptions")
tpOptions.ShouldReserveServer = true
tps:TeleportAsync(PlaceId,game.Players:GetChildren(),tpOptions)
end)
task.wait(10)