Log in to vote

Bad Argument #1 to 'remove'(table expected, got nil) Does anyone know how to fix this?[SOLVED]

Asked by 1 year ago
Edited 1 year ago

Dont worry about it, I figured out I put a period there instead of a comma XD

The script teleports players and as it is teleporting them it removes the spawn they landed on so people dont teleport on top of them or so no 2 people land on the same spawn. But I get an error?

Does anyone know how to fix it. Here the code :)

    local spawns = chosemap:WaitForChild("Spawns"):GetChildren()
    for _, player in pairs(game.Players:GetPlayers()) do 
        if player and #spawns > 0 then
            local uppertorso = player.Character:WaitForChild("UpperTorso")
            local allspawns = math.random(1, #spawns)
            local randomspawns = spawns[allspawns]
            if randomspawns and uppertorso then
                uppertorso.CFrame = +, 3, 0))

Thank you for your time

Answer this question