Help creating a bar that fills up using Frames

Hi, I’m trying to create a bar that fills up when a type of value is triggered.

1 Like

The Scale part of the UDim2 property is what you need to change.

Just convert the value (let’s say n) to a percentage and set the relevant scale to that value:

local n_percentage = n / n_max -- Converting value n to a percentage
bar.Size = UDim2.new(n_percentage, x_offset, y_scale, y_offset)

In other words, your bar will be n_percentage% scaled to its full size. You’ll probably also want to create another background bar with a darker color that is always fully scaled to give the bar an illusion of having a background.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.