I know how to do insert table but I dont know how to get a list of the players can someone help?
Heres my script so far:
local players = {}
I know how to do insert table but I dont know how to get a list of the players can someone help?
Heres my script so far:
local players = {}
Use a for loop
local players = {}
for i,v in pairs(game.Players:GetChildren()) do --where i is the index and v is the value
table.insert(players,v.Name) --v is each player in the game so .name is their name
end
game.Players:GetPlayers() returns a list of all of the players currently in the game.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
thank you so much i didnt even know you could do that. :D