Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to count the length of a table?

So, i have a system here that imports a list of members, gives the list a name, but i need it to count the amount of players in the list, because it will be constantly changing.

AxMembers = game:HttpGet('https://pastebin.com/raw/tbLeesMx')
   -- once the table has been counted, it is put into variable 'tablecount'.
    while true do
    ALL_PLAYERS = game:GetService("Players")
    for v in 1,tablecount do
    for i, player in pairs(ALL_PLAYERS:GetPlayers()) do
    if player.Name == AxMembers[v] then
	    game.CoreGui.RobloxGui.PlayerListContainer.ScrollList:FindFirstChild(player.Name).BGFrame.MembershipIcon.Image = 'rbxassetid://714343976'
	    wait(1)
	end
    end
    end
    end

1 comment

0

Please read the code in Source.

1 answer

lmao

local MyTable = {"Hi", true, false}
local TableLenght = #MyTable
print(TableLenght)

output: 3

1 comment

0

Cheers, Some things you just can't find on the internet. Lifesaver.

This discussion is preserved as it was. New answers, comments, and votes are closed.