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

All Players Are Teleporting to The Same Spawn?

Asked by 3 years ago
local s = script.Stat
local vals = game.ReplicatedStorage.vals

t = 0
game.Players.PlayerAdded:connect(function(player)


    while true do
        local arenaSpawns = workspace.Spawns:GetChildren()
    t = 5
    repeat
        t = t-1
        s.Value = "Intermission.. "..t
        wait(1)
    until t == 0
    s.Value = "Game starting!"


        wait()

        s.Value = "Teleporting Players To Their Plots"
        wait(5)


        local spawnLocation = arenaSpawns[1]
        player.Character:MoveTo(spawnLocation.Position)
        table.remove(arenaSpawns,1)
        t = 50
        repeat
        t = t-1
        s.Value = "Time Reamining: "..t
        wait(1)
        until t ==0

        end
    end)

I am trying to make it to where once the intermission is up, all players get teleported to different spawns. But how come they are all going to the same spawn?

Answer this question