Skip to content

Instantly share code, notes, and snippets.

@acs
Created December 17, 2023 20:04
Show Gist options
  • Save acs/14ac9eebdeef7d7a6ea76939f4c04c8b to your computer and use it in GitHub Desktop.
Save acs/14ac9eebdeef7d7a6ea76939f4c04c8b to your computer and use it in GitHub Desktop.
Decrease the size of an object in Roblox (progress bar)
print("Adjusting recharge bar")
local visibleBar = script.Parent.Parent.Parent
local bar = script.Parent
local totalSeconds = 5
local stepSize = bar.Size.X.Offset/totalSeconds
repeat
task.wait(1)
bar.Size = UDim2.new(0, bar.Size.X.Offset-stepSize, 0, bar.Size.Y.Offset)
until bar.Size.X.Offset < 0
visibleBar.Enabled = false
print("Size configured!!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment