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

HTTP 403 (Forbidden) How to fix that?

Asked by 4 years ago
Edited 4 years ago

I have a script:

local Id = "000000000" -- Don't mind there's should be real Id

local TeleportService = game:GetService("TeleportService")

local Trigger = game.Workspace.TeleportTriggerLeft

Players = game:GetService("Players")

Trigger.Touched:Connect(function(trigger)

    local character = trigger.Parent

    local player = Players:GetPlayerFromCharacter(character)

    print(player.Name.. " Touched the trigger!")

    local Reserve = TeleportService:ReserveServer(game.Id)

    TeleportService:TeleportToPrivateServer(game.Id, Reserve, player)

end)

But when script trying to take Reserve there's error HTTP 403 (Forbidden).

1 answer

Log in to vote
2
Answered by 4 years ago

You're using game.Id wich doesn't exist, you have to use PlaceId So instead of game.Id use game.PlaceId Also, the third argument for :TeleportToPrivateServer() must be a table, not a player.

So you have to do this

local Id = "000000000" -- Don't mind there's should be real Id

local TeleportService = game:GetService("TeleportService")

local Trigger = game.Workspace.TeleportTriggerLeft

Players = game:GetService("Players")

Trigger.Touched:Connect(function(trigger)

    local character = trigger.Parent

    local player = Players:GetPlayerFromCharacter(character)

    print(player.Name.. " Touched the trigger!")

    local Reserve = TeleportService:ReserveServer(game.PlaceId)

    TeleportService:TeleportToPrivateServer(game.PlaceId, Reserve, {player})

end)

If this answered your question mark it as the answer!

0
and make sure to use an if statement to make sure that `GetPlayerFromCharacter` returns a player object and not `nil` User#23252 26 — 4y
0
You should use a Humanoid Filter when trying to derive a Player Object from a Touched signal. Ziffixture 6913 — 4y
Ad

Answer this question