✓ Accepted answer
Well I think you know a bit about tables, but in case if you don't, here
So what you are doing is almost right, but the pickedplayer variable isn't actually a player, it's number that is randomly generated from 1 to #player (aka how many players there are).
This number is the index of the player, so technically if you wanna get the player you wanna do
players[pickedplayer], since players is a table, we have to put a [] next to it, and give the index of the chosen players inside of it, which should give us what we want which is the player.
And then you just do players[pickedplayer].Name which is the name property of the player.
We can also rearange it a bit to make it better.
local gameon = false
while gameon == false do
gameon = true
intermission = 15
wait(intermission)
local players = game.Players:GetChildren()
if #players > 0 then
local player = players[math.random(1, #players)]
print(player.Name)
else
gameon = false
wait(5)
end
end
2 comments
wayyyy better than my take on it.
nice try though!