In my game Mount of The Gods players are sometimes unable to teleport to the Lobby place. The ID and function that teleports them to said place is the same every time, and there is no reason that something like this would be happening.
My code to teleport everyone is just a simple remoteEvent call.
TUTORIAL = 478459751
LOBBY = 481987774
HUD.MainMenu.Lobby.MouseButton1Down:connect(function()
game.ReplicatedStorage.Resources.Remotes.Teleport:FireServer(LOBBY)
end)
HUD.MainMenu.Tutorial.MouseButton1Down:connect(function()
game.ReplicatedStorage.Resources.Remotes.Teleport:FireServer(TUTORIAL)
end)
Where the server hook is as follows:
game.ReplicatedStorage.Resources.Remotes.Teleport.OnServerEvent:connect(function(player,id)
TeleportService:Teleport(id,player)
end)
The values for these constants never change, there is no situation in which either of the IDs will not work, yet still I get tons of reports of illegal teleport destinations. My only explanation is that teleportservice is possibly trying to teleport the player to a server that is running on a different platform, given that my game has a pretty equal following of both PC and XBOX players. I have no way to test this.
Here is a link to the place https://www.roblox.com/games/460710135/Mount-of-the-Gods, the code can be found in MainMenu(Playerscripts) and PlayerManager(ServerScriptService)