How do I pcall to reserve a server?

image
Everytime I try to teleport to a reserved server in my game it says this. I have allow access to http requests and allow third party teleports on.


There seems to be no info on this but the few articles I found said something about a pcall. The thing is I dont know how to pcall a reserved server.

Here is the code… so basically its a timer that when it hits 0 is supposed to teleport all the players in a folder to a reserved server. But it keeps giving me the HTTP 403 error code. Any help is useful.
NOTE: I’m trying to teleport to a place created from my game. Ex
image
ZombieZ is the main game and the place im trying to teleport to is Long Winter.

Try doing it in a live game. TeleportService doesn’t work in Studio.

Tried it in a live game and it doesnt work.

What does the DevConsole say?

In your code you seem to be teleporting each player on a for loop, try inserting the players in a table then “teleport” the table, as the function has these parameters:

If you are trying to reserve a server of a different game then it won’t work. You can only teleport to other games, not reserve a server. You should be able to reserve a server if it’s apart of the same game.

Try doing this instead because you should pass a table containing player instance not a player instance.

telepoortserve:TeleportToPrivateServer(serverid, code, {player})

You can’t reserve a server in studio or it will give you that specific error everytime. Although, we understand if it says this, it should work when testing in the real game.

One more problem, you must send an array to the third argument for the players you want to teleport instead of just the instance itself.

teleportserv:TeleportToPrivateServer(serverId, code, {player})

Looking at the script, as long as the TeleportToPrivateServer function actually runs and the serverId is the PlaceId you are reserving the server for, this should work fine.

I fixed it without the table or anything, thx for the help though guys