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?
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!
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.
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!
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.
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!