PrivateServerId not working for teleportation?

I have a private server system that works with codes and when a player types a code and the script finds a server with this code then it will teleport the player to the server that has this code, but the problem is that I can’t teleport the player to the server because of the game.PrivateServerId isn’t working for teleportation and something will come up on the screen and say “Attempted to teleport to a restricted place”.

Just do it on description below on your game.