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

random #2 interval is empty??

Asked by 10 years ago
    local lobbyspawns = {}

    for _, v in pairs(game.Workspace:WaitForChild("Lobby"):GetChildren()) do
        if v and v.Name == "SpawnLocation" then
            table.insert(lobbyspawns, v)
        end
    end

    for _, player in pairs(activecontestants) do
        if player then
            awardpoints(player, 1)
            if player.Character then
                local humanoid = player.Character:FindFirstChild("Humanoid")
                if humanoid then
                    humanoid:UnequipTools()
                end
            end

            local randomspawn = lobbyspawns[math.random(1, #lobbyspawns)]
            player.Character:MoveTo(randomspawn.Position)

ServerScriptService.MainScript:275: bad argument #2 to 'random' (interval is empty) Why won't this work. I have tried the wiki and nothing works.

Answer this question