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

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

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

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

2 comments

0

how would i fix that?

0

Idk watch a tutorial

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