ReservedServer http 403 forbidden

I did make the TeleportService:TeleportToPrivateServer (roblox.com) a few days ago and it works

But this day, doesn’t work, but why?

My script:

   local TeleportService = game:GetService("TeleportService")
local remoteEvent = game.ReplicatedStorage.Teleport

local function serverReceiveEvent(player)
	local reserveCode = TeleportService:ReserveServer(game.PlaceId)
	TeleportService:TeleportToPrivateServer(game.PlaceId, reserveCode, {player})
end

remoteEvent.OnServerEvent:Connect(serverReceiveEvent)

Make sure you still have HTTP Service enabled, also hit F9 and see if it has errors. It could be that the server was taken already.

What im making is, The server script teleports the selected player to the place

Ahh ok, then ignore what I said above. It’s probably a HTTP error.

The error is in the line 5(The reservedServer)

Ok I tested your script and I got an error too, I’ll try see what the issue is, I just got an error on this line

	local reserveCode = TeleportService:ReserveServer(game.PlaceId)

it threw a

[HTTP 403 (Forbidden)] error

Try testing it in game rather than in studio

Hello

You cant use teleport service in studio. Doing it in the game will fix. Just add this before the line of you dont want the error:

local RunService = game:GetService("RunService")
local TeleportService = game:GetService("TeleportService")
local remoteEvent = game.ReplicatedStorage.Teleport

local function serverReceiveEvent(player)
    if RunService:IsStudio() then warn("Cannot use teleport service in studio!") end
	local reserveCode = TeleportService:ReserveServer(game.PlaceId)
	TeleportService:TeleportToPrivateServer(game.PlaceId, reserveCode, {player})
end

remoteEvent.OnServerEvent:Connect(serverReceiveEvent)

still doesn’t work, i also know that you cannot use teleport service in studio :confused:

I tried the script in my own game, it all worked. Are you sure your remote event is firing?

yea, i did make the script to fire the remote event

Did you make the script to fire the remote event from a local script? For example, I had a button in a screen gui containing a local script with these contents:

script.Parent.MouseButton1Click:Connect(function()
	game.ReplicatedStorage.Teleport:FireServer()
end)

The script are the same as mine, it doesn’t work. I don’t get it

Try just pasting this code in instead:


local TeleportService = game:GetService("TeleportService")
local remoteEvent = game.ReplicatedStorage.Teleport

local function serverReceiveEvent(player)
	local reserveCode = TeleportService:ReserveServer(game.PlaceId)
	TeleportService:TeleportToPrivateServer(game.PlaceId, reserveCode, {player})
end

remoteEvent.OnServerEvent:Connect(serverReceiveEvent)

Then ensure you publish the changes, File Save To Roblox and File Publish To Roblox, then test in game.

You cant reserve servers in studio. If you want to do this, try it in the actual game then it should work fine.

i know about that man, it still doesn’t work!