I am trying to use values on players as codes for their roles in a game. I cannot think of a way to randomize the values in the players without some values being the same.
My only attempt:
local numhelp = Instance.new('NumberValue')
numhelp.Value = game.Players.NumPlayers
for _,v in pairs(game.Players:GetChildren()) do
local num = numhelp.Value
v.CharType = num
numhelp.Value = numhelp.Value - 1
end
end
It took me a while to think this up, but it isn't randomized. I need help randomizing the values without alike values. I am trying also to get the randomization numbers to go from 1 to the number of players.

6 comments
You could check out http://wiki.roblox.com/index.php?title=Random_numbers It will be useful for you.
thanks
you also have a extra end wich will error.
but how do i make different randomizations to be all different numbers?
the end was a part of the while true loop for the game
i posted a code fix (hopefully) in the answer section