of     1   

blimp80
#183108658Saturday, February 06, 2016 8:12 PM GMT

local playersgathered function getplayers() local players = game.Players:GetChildren() for i=1, #players do playersgathered = players[i] end end while true do wait(5) getplayers() print(playersgathered.Name) end -----When the first player joins, it prints that player's name every 5 seconds. When the second player joins, it then prints the second player's name every 5 seconds instead of printing both players' names. How do I make it print all players' names?
blimp80
#183111492Saturday, February 06, 2016 9:05 PM GMT

Bump
blimp80
#183328825Wednesday, February 10, 2016 6:06 PM GMT

Soooo no one knows?..
Ultraw
#183328998Wednesday, February 10, 2016 6:10 PM GMT

local playersgathered function printplayers() local players = game.Players:GetChildren() for i=1, #players do playersgathered = players[i] print(players[i].Name) end end while true do wait(5) printplayers() end
cheesecake123456
#183329147Wednesday, February 10, 2016 6:13 PM GMT

local playersgathered function getplayers() local players = game.Players:GetChildren() for i=1, #players do playersgathered = players[i] end end while true do wait(5) getplayers() print(playersgathered.Name) end Playersgathered is just a variable that equals nil, what getplayers is doing is setting playersgathered to the first person, then to the second person, so it prints the second person each time. If you want it to print all their names you need to do: local playersgathered = {} function getplayers() playersgathered = {} local players = game.Players:GetChildren() for _, v in pairs(players) do table.insert(playersgathered, v) end end while wait(5) do getplayers() for _, p in pairs(playersgathered) do print(p.Name) end end
cheesecake123456
#183329171Wednesday, February 10, 2016 6:14 PM GMT

Sorry for putting your code above mine, was using it for reference XD
blimp80
#183329277Wednesday, February 10, 2016 6:16 PM GMT

Hahaha thanks man

    of     1