Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I use TeleportPartyAsync or TeleportToPrivateServer?

I'm trying to create a script that teleports a group of players if they are "Ready" for the game, but whenever I try to use Teleport Party A Sync or Teleport To Private Server, it comes up with an HTTP 403 Error. Here's the code:

local timeleft = game:GetService("ReplicatedStorage"):WaitForChild("TimeLeft")
local teleserv = game:GetService("TeleportService")
local gameid = 3171170063

while true do
	for a = 1,timeleft.Value do
		timeleft.Value = timeleft.Value - 1
		wait(1)
	end
	for _,plr in pairs(game.Players:GetChildren()) do
		if plr:WaitForChild("Ready").Value == true and plr:IsA("Player") then
			print(plr.Name.." is ready to be teleported!")
			local reserve = teleserv:ReserveServer(gameid)
			teleserv:TeleportToPrivateServer(gameid,reserve,plr)
		else
			print(plr.Name.." was not ready for the party.")
		end
	end
	wait(5)
	timeleft.Value = 45
end

1 answer

✓ Accepted answer

I had that 403 error before, took me two days to find out. nothing to do your code, but the you may get the same error if you have wrong gameId.

No.1 cause, you cannot teleport from studio, it will give you 403. you have to publish both lobby and place in Roblox, enter the lobby from roblox player(not studio).

No.2 cause, it is your place settings.

go to roblox studio, on the menu bar, click "game settings", go to options, click "Allow HTTP Requests" to be "on". I activated this option in all places.

1 comment

0

Thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.