I am using the teleport service :ReserveServer() and :TeleportToPrivateServer() to teleport players into a new place. The code is as follows:
local playerstotele = {}
for i,v in pairs(game.Players:GetPlayers())do
if v:FindFirstChild("PlayerData") then
if v.PlayerData.CurrentLobbyData.CurrentState.Value == buttonID then
table.insert(playerstotele,v)
game.ReplicatedStorage.Events.HideExitButton:FireClient(v)
end
end
end
local code = game:GetService("TeleportService"):ReserveServer(4745593789)
game:GetService("TeleportService"):TeleportToPrivateServer(4745593789,code,playerstotele)
I know i need to add Pcall to this, but I am getting about a 50% success rate when publishing and playing. Some people are able to teleport fine, while the other people get error 771 (teleport failed, server is no longer available). This is happening almost every single time. Is this expected, or am I doing something wrong?
if the reserved server stays without players for some secs it will shutdown, try adding a pcall and if it doesn’t work then wait two seconds then retry
Hi there, not sure if this will help. But I’ve also gotten the same issue when I play solo times while joining reserved servers. Once the BindToClose() is called, I just wait(2). Not sure if that helps or not? I know after the server shuts down, it has a max yield of 30 seconds before forced shutdown.
No sadly, it still happens but it seem to have calmed down. I would estimate that only 1/50 players encounter this (based on feedback and me not experiencing it.)