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

I am trying to make a queue system but I keep getting these errors. Can anyone help?

Asked by 1 year ago

Here are the errors

21:18:19 -- Argument 3 missing or nil Stack Begin Script 'Workspace.Pad1.Script', Line 30 Stack End

all of those errors are from this script.

Here is my code

local PlayersToTeleport = {}
local MaxPlayers = 3
local ts = game:GetService("TeleportService")

script.Parent.Touched:Connect(function(TouchedPart)
    if TouchedPart.Parent:FindFirstChild("Humanoid") then
        local Character = TouchedPart.Parent
        local Player = game.Players:GetPlayerFromCharacter(Character)
        local AlreadyInTable = false

        for _, OtherPlayer in next,PlayersToTeleport do
            if OtherPlayer == Player and MaxPlayers < 3 then
                wait(.6)
                AlreadyInTable = true
            end
        end
        if not AlreadyInTable then
            table.insert(PlayersToTeleport,Player)
        end
    end
end)

repeat
    if game.Workspace.TwoPlayerPlayers.Value < 3 then
        repeat
            wait(.01)
        until game.Workspace.TwoPlayerPlayers.Value > 2
        wait(12)
        local code = ts:ReserveServer(11299666436)
        ts:TeleportToPrivateServer(11299666436, PlayersToTeleport)
        table.remove(PlayersToTeleport)
    end
until game.Workspace.TwoPlayerPlayers.Value == 47890235

1 answer

Log in to vote
0
Answered by
Puppynniko 1059 Moderation Voter
1 year ago
Edited 1 year ago

TeleportToPrivateServer takes in 3 or more variables these are placeId: number, reservedServerAccessCode: string, players: Objects, spawnName: string, teleportData: Variant, customLoadingScreen: Instance and you are missing reservedServerAccessCode

0
how would i fix that? VictoreRoyale667 8 — 1y
0
Idk watch a tutorial Puppynniko 1059 — 1y
Ad

Answer this question