Hi today i made a battle royale game on roblox but when i try doing the matchmaking script it keeps erroring with "Argument 3 or missing nil" heres the script its erroring at line 18.
while true do local Teleporters = {} local IsInTable = false local TS = game:GetService("TeleportService") local code = TS:ReserveServer(5970897194) script.Parent.Touched:Connect(function(t) if t.Parent:FindFirstChild("Humanoid") then if IsInTable == true then return end table.insert(Teleporters,game.Players:FindFirstChild(t.Parent.Name)) IsInTable = true for i = 10,0,-1 do script.Parent.BillboardGui.TextLabel.Text = i wait(1) end for i, v in pairs(Teleporters) do TS:TeleportToPrivateServer(5970897194,code,game.Players:FindFirstChild(v)) table.remove(Teleporters,v) end end end) wait() end wait()
Argument 3 is the game.Players:FindFirstChild(v)
and this would not work because you have already done that in line 11, where you insert the player that you already found into the table.
So no need to do that.
while true do local Teleporters = {} local IsInTable = false local TS = game:GetService("TeleportService") local code = TS:ReserveServer(5970897194) script.Parent.Touched:Connect(function(t) if t.Parent:FindFirstChild("Humanoid") then if IsInTable == true then return end table.insert(Teleporters,game.Players:FindFirstChild(t.Parent.Name)) IsInTable = true for i = 10,0,-1 do script.Parent.BillboardGui.TextLabel.Text = i wait(1) end TS:TeleportToPrivateServer(5970897194,code,Teleporters) Teleporters = {} end end) wait() end wait()
Hi, your issue is the defining factor, you have to define it!