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

Why is this random map chooser not working?

Asked by 10 years ago
if game.Workspace.GameBegin.Value == "Begin" then

    maps = game.ServerStorage.Maps:GetChildren()
    map = maps[math.random(1, #maps)]
    map:Clone().Parent = game.Workspace

    players = game.Players.GetPlayers()
    different = players[math.random(1, #players)]
    if different.Character then
        different.MoveTo(map.RedSpawn.Position)
    end

    for _,player in pairs(game.Players:GetPlayers()) do
        if player.Character and player.Name ~= different.Name then
            player.Character:MoveTo(blueSpawns[map.BlueSpawn.Position])
        end
    end
end
0
Are their any errors? User#3 0 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

It doesn't look as if blueSpawns was ever defined, unless this is not your entire code.

Ad

Answer this question