I am making a tower defence game and it was previously a 1 man server so I'm making it so multiple people can play in the same server but I need to give players there own numbers. Basically I want every player to have a different number, but ima make it so there is only 4 numbers. So I can address each player.
game.Players.PlayerAdded:connect(function(p)
local stats = Instance.new("IntValue")
stats.Name = "team2"
stats.Parent = p
local money = Instance.new("IntValue")
money.Name = "which"
money.Value = 1
money.Parent = stats
p.team2.which.Value = math.random(1,4)
end)

1 comment
You are using it correctly, but there's one issue. There's the possbility of the teams value to be the same as the other one, since there's only a 25% chance to have duplicates.