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

How would I add a UDim value to a TextLabel based on the amount of values in a table?

Asked by 8 years ago

For example, if I have a table;

a={"a","b","c"}

How would I make the TextLabel move down based off of #a?

1 answer

Log in to vote
1
Answered by
Pyrondon 2089 Game Jam Winner Moderation Voter Community Moderator
8 years ago

By using a for loop.

for i=1,#a do
    local label = Instance.new("TextLabel") 
    label.Position = UDim2.new(0, 0, (i * 10)/100, 0)  -- Replace 10 with whatever number you want to scale by.
Ad

Answer this question