When I try to teleport to my game, I keep getting errors. I get the HTTP error while using the reserve derver function. The error code is from when testing on roblox.
I am using a server script in serverscriptservice. I got my ID from my asset manager. I own both places and my HTTP requests are enabled.
Here is my server script.
local teleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(Player, Code)
local ID = teleportService:ReserveServer(Code)
teleportService:TeleportToPrivateServer(Code, ID, {Player})
end)
Here is my local script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local event = ReplicatedStorage.RemoteEvent
event:FireServer(10571270983)
Did you disabled the new security features that prevent game to teleport users in another place?
(It’s under your settings on the Roblox Studio App)
*Hey here I just realised what was the code, you can’t teleport someone to a private server if you don’t create it before, See TeleportService:TeleportToPrivateServer
Exemple from the docs :
local TS = game:GetService("TeleportService")
local Players = game:GetService("Players")
local code = TS:ReserveServer(game.PlaceId) -- Returns a code
local players = Players:GetPlayers() -- Get a list of all players
TS:TeleportToPrivateServer(game.PlaceId,code,players) -- Actually teleport the players
-- You could add extra arguments to this function: spawnName, teleportData and customLoadingScreen
Hey, sorry, you indeed created them, I got lost because of the name code used as the placeID and ID used a the server code. Is this error only appening inside Roblox Studio or on the Roblox Client too?