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

Help With A Random Number Chooser?

Asked by
Scootakip 299 Moderation Voter
8 years ago
mapc.Value = (math.random(2))
    wait(1)
    if mapc.Value == 1 then
      print(mapc.Value)
      player.Character.Torso.CFrame = ToMapOne + Vector3.new(0, i * 5, 0)
      player.TeamColor = game.Teams["Playing"].TeamColor
        for i, m1 in ipairs(game.Workspace.MapOne:GetChildren()) do
    m1.Transparency = 0
    m1.CanCollide = true
end
        end 
    if mapc.Value == 2 then
        print(mapc.Value)
        player.Character.Torso.CFrame = ToMapTwo + Vector3.new(0, i * 5, 0)
        player.TeamColor = game.Teams["Playing"].TeamColor
        for i, m2 in ipairs(game.Workspace.MapTwo:GetChildren()) do
    m2.Transparency = 0
    m2.CanCollide = true
end

The above isn't the entire script, but it's part of it. The problem is that when the script is told to pick a random number, it chooses a number for each player in the game. Can someone help me fix it so that it only chooses one number rather than a number for each player?

Answer this question