Closed ConfidentCoding1 closed 7 years ago
First of all the players are contained in the data.players
field of the table. Second, even if you tried to get the length of this it would not work because it is a dictionary and you cannot get the length of those using #
. Here is what you would do to get the number of players returned:
local function count (t)
local sum = 0
for i in next, t do
sum = sum + 1
end
return sum
end
local players = api.getPlayers(6, 4, false).data.players
print(count(players))
Thank You!
I am trying to call the GetPlayers function from Roblox Studio.
However every time I call the function the returned table always as 0 entries/arrays in it.