i am making a random player chooser, a chosen player will get their name printed on the output, however, it prints out the number "1" out of a table instead of their name. the script is:
players = {}
local function onCharacterAdded(chr)
table.insert(players, chr)
local value = math.random(1,#players)
print(value)
end
game.Players.PlayerAdded:Connect(onCharacterAdded)
i was going to give the chosen player a tool, however i don't know if it will work if its going to print out numbers.

1 comment
math.random(min,max) always returns a numer value