Hello and I’m making a system that whenever my game shut down all players will be teleported into another server but it seems it’s not working properly.
Script:
local TweenService = game:GetService("TweenService")
local TeleportService = game:GetService("TeleportService")
local gameId = --GameId (I was typing this manually, i'm not in studio rn but I have the Game Id)
local updateMessage = script.Parent
local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)
local fadeTween = TweenService:Create(updateMessage, tweenInfo, {BackgroundTransparency = 0}
game:BindToClose(function()
local reservedServer = TeleportService:ReserveServer(GameId)
fadeTween:Play()
TeleportService:Teleport(reservedServer, GameId)
end)