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

Why is TeleportToPrivateServer Giving a HTTP 403 Forbidden Error?

My program will teleport the people to a private server. HTTP and API is enabled. PlayersToTeleport is a table. Why is this giving me an error?

local TS = game:GetService("TeleportService")
local code = TS:ReserveServer(4830926172)
TS:TeleportToPrivateServer(4830926172, code, PlayersToTeleport)

2 comments

0

You script is right, but sometime the connection can be mess up and throw some error. The solution is using pcall() https://riptutorial.com/lua/example/16000/using-pcall

0

I used pcall and im still getting an error. Is there possibly any other reason why this is happening?

1 answer

here is your problem the players to teleport needs to be a table of player for example you could have the script get players

local TS = game:GetService("TeleportService")
	local code = TS:ReserveServer(4830926172)
local players = game.Players:GetPlayers()
   TS:TeleportToPrivateServer(4830926172, code, PlayersToTeleport)

but if you are trying to make them teleport when touched





local part  = script.Parent -- when this is touched it will trigger the event i will leave it as ----- script.parent
local tableplayers = {}
part.Touched:Connect(function(hit) -- the argument
if game.Players:GetPlayerFromCharacter(hit.Parent) then

local player = game.Players:GetPlayerFromCharacter(hit.Parent)

table.Insert(tableplayers, player)




end

end)
-- maybe a while true do statement here?

while true do
wait(25)
   TS:TeleportToPrivateServer(4830926172, code, tableplayers)   
end

-- im sure this will work if it does not tell me

2 comments

0

sorry about some spelling errors

0

He said, PlayersToTeleport is a table.

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