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

Argument 3 or missing nil on my teleport script?

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()


2 answers

✓ Accepted answer

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()

16 comments

0

It fixed that issue but new theres a error "unable to cast value to object"

0

What line?

0

line 11

0

wait wrong line lemme find it

0

Okay

0

line 19

0

ok it was 18 my bad again lol

0

Try removing the {} and see if that changes anything

0

ok

0

wait the table thingy?

0

Yeah

0

The ones next to v

0

If that doesn’t work I have a better way that most likely will work

0

but there is no {} next to the v

0

You still there?

0

Yeah sorry I’m back, I edited the script, try it now

Hi, your issue is the defining factor, you have to define it!

1 comment

0

I still got the same error

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