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.
CODE:
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)
thanks :)

4 comments
Just move "local num = math.random(1,10)" under "players.PlayerAdded:Connect(function(players)" and it should work out for you.
forgot to mention, its in a script in ServerScriptService if that matters at all
That doesn't really matter. Just go on with what I described and it should work.
Eyyy ty fam :)!