How to fix TeleportService HTTP 403 (Forbidden) error? | 어떻게 하면 TeleportService HTTP 403 (Forbidden) 오류를 해결할 수 있을까요?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to use TeleportService’s ReserveServer(), TeleportToPrivateServer() without error.

  2. What is the issue? Include enough details if possible!
    I am trying to TeleportServece:ReserveServer() and I am getting an HTTP 403 (Forbidden) error.

  3. What solutions have you thought of so far?
    Contents in <> are numeric ids.

local TeleportService = game:GetService("TeleportService")
local varPlaceId = <PlaceId>
local players = game.Players:GetPlayers()

--test1: HTTP 403 (Forbidden)
local RsvSer = TeleportService:ReserveServer(<PlaceId>)
TeleportService:TeleportToPrivateServer(<PlaceId>, RsvSer, players)

--test2: HTTP 403 (Forbidden)
local RsvSer = TeleportService:ReserveServer(varPlaceId)
TeleportService:TeleportToPrivateServer(varPlaceId, RsvSer, players)

--test3: HTTP 403 (Forbidden)
local code= TeleportService:ReserveServer(<PrivateServerId>)
TeleportService:TeleportToPrivateServer(<PrivateServerId>, code, players)

--test4: HTTP 403 (Forbidden)
local code = TeleportService:ReserveServer(game.placeId)
TeleportService:TeleportToPrivateServer(game.placeId, code, players)

--test5: Unable to cast string to int64
local code = TeleportService:ReserveServer(game.PrivateServerId)
TeleportService:TeleportToPrivateServer(game.PrivateServerId, code, players)

Why am I getting an HTTP 403 Forbidden error? How can I solve this?

Korean-----------------------------------------------------------------------------------------------

  1. 무엇을 성취하고 싶나요?
    TeleportService의 ReserveServer(), TeleportToPrivateServer()를 오류 없이 사용하고 싶습니다.

  2. 문제가 무엇인가요?
    TeleportServece:ReserveServer()를 시도하는데 HTTP 403 (Forbidden) 오류가 발생합니다.

  3. 지금까지 생각해낸 해결책은 무엇입니까?
    <>안에 있는 내용은 숫자형의 id입니다.

local TeleportService = game:GetService("TeleportService")
local varPlaceId = <PlaceId>
local players = game.Players:GetPlayers()

--test1: HTTP 403 (Forbidden)
local RsvSer = TeleportService:ReserveServer(<PlaceId>)
TeleportService:TeleportToPrivateServer(<PlaceId>, RsvSer, players)

--test2: HTTP 403 (Forbidden)
local RsvSer = TeleportService:ReserveServer(varPlaceId)
TeleportService:TeleportToPrivateServer(varPlaceId, RsvSer, players)

--test3: HTTP 403 (Forbidden)
local code= TeleportService:ReserveServer(<PrivateServerId>)
TeleportService:TeleportToPrivateServer(<PrivateServerId>, code, players)

--test4: HTTP 403 (Forbidden)
local code = TeleportService:ReserveServer(game.placeId)
TeleportService:TeleportToPrivateServer(game.placeId, code, players)

--test5: Unable to cast string to int64
local code = TeleportService:ReserveServer(game.PrivateServerId)
TeleportService:TeleportToPrivateServer(game.PrivateServerId, code, players)

HTTP 403 Forbidden 오류가 왜 발생하는 것일까요? 어떻게 하면 해결할 수 있을까요?

1 Like

It has to be done server side, assuming this is a LocalScript.

2 Likes

Make sure you have HTTP Services enabled in Game Settings.

I’m running this script in ServerStorage’s ModuleScript. Do you mean that I need to change this to LocalScript?

HTTP service has already been set to allow!

No, you’re fine. If you require the ModuleScript in ServerStorage from a Script then it’s fine. As for the other post, the Http toggle in Game Settings does not influence the ability to teleport.

Your code looks fine. If you’re getting a forbidden teleport error then that means you can’t create a reserved server for the place in question. Are you the owner of the place you’re trying to create a reserved server for, or if it’s a group experience then do you have edit access to it?

Teleport HTTP error codes are in the 700 range if the place is restricted but you have access to teleport to it, so I’m thinking in this case it has more to do with where you’re trying to teleport to rather than the code itself. All of these samples are resulting in HTTP 403s rather than HTTP 700-799s.

Could you maybe share which PlaceId you’re trying to reserve a server for?

1 Like

You can only reserve a server if the game you’re trying to teleport to is part of your main game/lobby’s universe. Regardless of whether you own it or not, it has to be in the same universe. Kindly make sure it is!

1 Like

Thank you for your answer @colbert2677 , @tyrencia
The map I want to arrive teleport is my own Place, and I want to teleport to B Place that exists in A Place.

So they are all part of the same universe, yeah? They’re not entirely separate places that are not related to each other at all?

Yes, it is. It’s my own Place, and as shown in the figure, there’s an error in the Reserve Server() from MainPlace to SubPlace.

image

Is the placeId correct? Did you right click on SubPlace and get the place ID instead of going to your game’s page and getting the ID? Sorry for asking dumb questions, but I’m just making sure that all the basic stuff has been done!

1 Like

I have the exact same problem.

Alright, I received help from someone and it worked! First, make a new game file and add a script inside server script service or whatever folder you want, paste this code.

local TS = game:GetService("TeleportService")
local Players = game:GetService("Players")
local DSS = game:GetService("DataStoreService")
local DS = DSS:GetGlobalDataStore()
 
-- Get the saved code
local code = DS:GetAsync("ReservedServer")
if type(code) ~= "string" then -- None saved, create one
	code = TS:ReserveServer(game.PlaceId)
	DS:SetAsync("ReservedServer",code)
end
 
local function Joined(plr)
	-- Everytime they chat, we want to know
	plr.Chatted:Connect(function(msg)
		if msg == "reserved" then -- Aha, that's our cue
			TS:TeleportToPrivateServer(game.PlaceId,code,{plr})
		end
	end)
end
 
-- Connect all current and future players
Players.PlayerAdded:Connect(Joined)
for k,v in pairs(Players:GetPlayers()) do
	Joined(v)
end

Now, publish the game by clicking on file and publish to roblox. Skip all the questions and hit create!

Go into your game and type in ‘reserved’. Wait a few seconds and you will teleport.

1 Like

I’m just grateful for the exact confirmation of the basics!
As you said, I right-clicked SubPlace and copied PlaceId!

1 Like

Thank you for sharing!
But It still not work.
image

image

That’s because you’re testing the game inside roblox studio. It will only work if you test it inside a published game instead of roblox studio.

3 Likes

Oh my god… Roblox Studio knew that teleport was impossible and thought it was a different problem because there was no warning. But now I know it was an exceptional situation.
Thanks to you, I was able to solve it. Thank you!

1 Like