Error when teleported

Hello devs!

i was trying to make a story game where you get in a car and it takes you to the real game using roblox studios place system / side place whatever it is called.

and it does not teleport the user

i have enabled http and api services but still does not work.

ERROR: HTTP 403 (Forbidden)

this is not the full code this is only a function.

local function GameStart()
	local tweenInfo = TweenInfo.new(10, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
	local tween = TweenService:Create(truck.PrimaryPart, tweenInfo, {CFrame = targetCFrame})
	tween:Play()
	TimerSign.Text = "leaving now!"
	task.wait(10)

	local seatedPlayers = {}
	for player, seat in pairs(inside) do
		if typeof(player) == "userdata" and player:IsA("Player") then
			table.insert(seatedPlayers, player)
		end
	end

	local reservedServerCode = TeleportService:ReserveServer(137578906255542)

	for _, player in ipairs(seatedPlayers) do
		TeleportService:TeleportToPrivateServer(137578906255542, reservedServerCode, player)
	end
end

if anyone knows please tell me i dont know alot about teleport service sorry :wave:t4:

The TeleportService doesn’t work in Studio so you need to publish the game to test it. You can publish it private so only you can access it.

Note that this service does not work during playtesting in Roblox Studio; to test aspects of your experience using it, you must publish the experience and play it in the Roblox application.

it is published and when tested in game does not return an error or anything or just does not teleport the players

the player must be inside an array, so just replace it with {player}

or just use your seatedplayers array and remove the for loop

One thing is that this function is documented as taking an array of players rather than a single player.

You have: TeleportService:TeleportToPrivateServer(137578906255542, reservedServerCode, player)

Should be: TeleportService:TeleportToPrivateServer(137578906255542, reservedServerCode, {player})

That isn’t the error I would expect from that problem though.

Since it’s 403 Forbidden make sure that the place you’re teleporting to has been published and that the player you are testing with has permission to access it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.