Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to count the length of a table?

Asked by 5 years ago

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
0
Please read the code in Source. TigerManGamingYT 2 — 5y

1 answer

Log in to vote
0
Answered by
SurfedZ 36
5 years ago

lmao

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

output: 3

0
Cheers, Some things you just can't find on the internet. Lifesaver. TigerManGamingYT 2 — 5y
Ad

Answer this question