#Better way of counting items in a container
23 messages · Page 1 of 1 (latest)
seems fine to me
and lua too xd
where
i mean u could also do :GetChildren() and get the length of the table but you also collect things that arent text labels
or how
but other than that u shouldnt care abt how long it is
local amount = 0 for _, v in pairs(player:WaitForChild("PlayerGui").Notifications.Container:GetChildren()) do if v:IsA("TextLabel") then amount += 1 end end
this only make the code unreadable
single line code is unbearable
yeah
i was thinking like u said :getchildren
and then collecting them from that
but that would be the same really
i'll jst keep it as it was then
Well you can just make a function called like GetChildrensOfClass and return a list of children that have that class, and just get the length of that array.