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

Argument 3 or missing nil on my teleport script?

Asked by 4 years ago

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

Log in to vote
0
Answered by
OhManXDXD 445 Moderation Voter
4 years ago
Edited 4 years ago

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()
0
It fixed that issue but new theres a error "unable to cast value to object" IEntity_303I 80 — 4y
0
What line? OhManXDXD 445 — 4y
0
line 11 IEntity_303I 80 — 4y
0
wait wrong line lemme find it IEntity_303I 80 — 4y
View all comments (12 more)
0
Okay OhManXDXD 445 — 4y
0
line 19 IEntity_303I 80 — 4y
0
ok it was 18 my bad again lol IEntity_303I 80 — 4y
0
Try removing the {} and see if that changes anything OhManXDXD 445 — 4y
0
ok IEntity_303I 80 — 4y
0
wait the table thingy? IEntity_303I 80 — 4y
0
Yeah OhManXDXD 445 — 4y
0
The ones next to v OhManXDXD 445 — 4y
0
If that doesn’t work I have a better way that most likely will work OhManXDXD 445 — 4y
0
but there is no {} next to the v IEntity_303I 80 — 4y
0
You still there? IEntity_303I 80 — 4y
0
Yeah sorry I’m back, I edited the script, try it now OhManXDXD 445 — 4y
Ad
Log in to vote
-2
Answered by
6kCrxzy -4
4 years ago

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

0
I still got the same error IEntity_303I 80 — 4y

Answer this question