So I’m trying to create an inventory with a scroling frame in there I have a lot of items and in all those items have a value wich shows the amount you have of that that item, it works fine I also have a text label wich needs to shows the value of how manny you have off that item, I could make in every single textlabel a script, but i tougth there must be a way to do it with one script but i don’t know how so can someone please help me with it? Heres the gui.
for _,item in itemsScrollingFrame:GetChildren() do
local amount = item:FindFirstChild('AmountItem')
if amount then
item.AmountItemShower.Text = tonumber(amount.Value)
amount = nil
end
end
Yes, I linked an article in my previous post of which explains it. A for loop will iterate through a table. Everything within the loop will happen to each item in the table.
local dictionary = {'a','b','c'}
for index,value in array do
print(index,value)
end
Output:
1 a
2 b
3 c
local dictionary = {apple='red',banana='yellow',grape='purple'}
for key,value in dictionary do
print(key,value)
end