TeleportService:ReserveServer() keeps bringing HTTP 403

Hello, devs! I am trying to make a button that fires a RemoteEvent which reserves a server and teleports the player to it. I would also like for the new place to show the code so other players can join. However, I am really stuck because when I try to reserve the server, it brings HTTP 403 (Forbidden). Thanks for any help!

Local Script:

local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
	game.ReplicatedStorage.CreateServer:FireServer(player)
	print("Fired!")
end)

Server Script:

local TeleportService = game:GetService("TeleportService")
local PlaceId = 7399821818

game.ReplicatedStorage.CreateServer.OnServerEvent:Connect(function(player)
    local code = TeleportService:ReserveServer(PlaceId)
	wait(5)
	TeleportService:TeleportToPrivateServer(PlaceId, code, player)
end)
2 Likes

Is it showing HTTP 403 when your teleporting the player or reserving the server?

It is showing HTTP 403 when I’m reserving the server.

This service does not work during playtesting in Roblox Studio , I suspect this would be your issue

I know that but I tried in the actual game and it does nothing.

Are you sure you own the place the script is reserving servers for?

Yeah, I created a new place and published it to the main place (the one with the issue right now.)

The player parameter needs to be in an array/table, so replace “player” with “{ player }”.

TeleportService:TeleportToPrivateServer(PlaceId, code, { player })

1 Like

Alright. Let me see if it works.

Wow. It works! Thank you! One question though, how can I send the code over to the new server? Is it already sent with the :TeleportToPrivateServer() function or would I need to add it in as an extra parameter? Thanks!

You can use teleport data to send the code with the player when they teleport to another server.

Refer to this for more info: https://developer.roblox.com/en-us/api-reference/function/TeleportService/TeleportToPrivateServer

Ok, thanks! (extra characters)