What I'm trying to do is when a player joins this game, it will roll a number between 1 and 3, If its 1 gui1 opens, and if its 2 or 3 gui2opens, my problem is the first player to join the game, lets say they get a 2 roll, everyone else gets a 2 role, not a 3 or 1. Even when the odds are raised to 1 and 10 it does the exact same thing. No errors. Besides that, the code works fine.
local players = game:GetService("Players") local num = math.random(1,10) players.PlayerAdded:Connect(function(players) if num == 1 then game.StarterGui.gui1.Enabled = true print(num) else game.StarterGui.gui2.Enabled = true print(num) end end)
I'd advice that you move "local num = math.random(1,10)" inside of the PlayerAdded function, so it does MathRandom function every time the player is added. Therefore getting a new number.