Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is TeleportToPrivateServer Giving a HTTP 403 Forbidden Error?

Asked by
ruwuhi 23
4 years ago

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)
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 Block_manvn 395 — 4y
0
I used pcall and im still getting an error. Is there possibly any other reason why this is happening? ruwuhi 23 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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

0
sorry about some spelling errors funrider28 30 — 4y
0
He said, PlayersToTeleport is a table. Block_manvn 395 — 4y
Ad

Answer this question