[SOLVED] Lobby Queue System Doesn't Teleport Players To Private Server?
Asked by
2 years ago Edited 2 years ago
I got the script from a youtube video and just edited some stuff i guess
https://www.youtube.com/watch?v=bxCKWMiV8CA
so this script is supposed to act like a casual story game lobby system, there's a timer and every time the timer ticks to 0, the players in the queue will get a loading screen and get teleported, and a GUI button appears to leave the queue, all of the script is working except the actual part that teleports the player to a private server of the placed. instead it gives me this error HTTP 403 (Forbidden)
at line 39
sorry if this isn't described well
Server Sided Script
01 | local TS = game:GetService( "TeleportService" ) |
02 | local TweenService = game:GetService( "TweenService" ) |
03 | local placeId = 12804178720 |
04 | local leaveGuiEvent = game.ReplicatedStorage:FindFirstChild( 'LeaveGuiEvent' ) |
05 | local TransitionEvent = game.ReplicatedStorage:FindFirstChild( 'TransitionEvent' ) |
07 | local billboard = script.Parent.billboardPart.billboardGui |
09 | local teleporting = false |
10 | local spawnTeleport = script.Parent.spawn |
12 | local function updateGui() |
13 | billboard.Frame.players.Text = "Players: " ..#list.. "/1" |
16 | local function removeFromList(character) |
18 | if list [ i ] = = character.Name then |
25 | local function teleportPlayers() |
27 | billboard.Frame.Status.Text = "TELEPORTING" |
28 | billboard.Frame.Status.TextColor 3 = Color 3. fromRGB( 255 , 0 , 0 ) |
29 | local playersToTeleport = { } |
30 | local teleportTime = 0 |
32 | if game.Players:findFirstChild(list [ i ] ) then |
33 | table.insert(playersToTeleport,game.Players:findFirstChild(list [ i ] )) |
34 | TransitionEvent:FireClient(game.Players:findFirstChild(list [ i ] )) |
39 | local code = TS:ReserveServer(placeId) |
41 | TS:TeleportToPrivateServer(placeId,code,playersToTeleport) |
42 | repeat wait() until #list < = 0 |
43 | billboard.Frame.Status.Text = "READY" |
44 | billboard.Frame.Status.TextColor 3 = Color 3. fromRGB( 255 , 0 , 0 ) |
49 | script.Parent.Gate.Touched:Connect( function (hit) |
50 | if hit.Parent:findFirstChild( "Humanoid" ) then |
51 | if teleporting = = false then |
52 | local char = hit.Parent |
53 | local player = game.Players:FindFirstChild(char.Name) |
54 | local alreadyExists = false |
57 | if list [ i ] = = char.Name then |
62 | if alreadyExists = = false then |
64 | table.insert(list,char.Name) |
65 | char.PrimaryPart.CFrame = spawnTeleport.CFrame |
67 | leaveGuiEvent:FireClient(player) |
70 | player.CharacterRemoving:connect( function (character) |
71 | removeFromList(character) |
79 | leaveGuiEvent.OnServerEvent:Connect( function (player) |
80 | if player.Character then |
81 | player.Character.HumanoidRootPart.Anchored = false |
83 | player.Character.Humanoid.Jump = true |
85 | player.Character:MoveTo(game.Workspace.chapter 1 sololeave.Position) |
86 | removeFromList(player.Character) |
94 | billboard.Frame.time.Text = timer |