-
What do you want to achieve?
I want to make a progressing bar that goes from left to right -
What is the issue?
The progress bar works, it just doesn’t go in the right way. I’m using a for loop to move it and it feels impossible to make it move the other way. (it goes from right to left instead of left to right) -
What solutions have you tried so far?
I’ve been checking on the dev forum, videos and even ask for help on discord and nothing helped
This is my code:
coroutine.wrap(function()
local boostTime = 5
local waitTime = 1
while true do
for i = currentBoost, 0, -1 do
local BAR_CHANGE_SIZE = i / currentBoost
playerBoostFrame.CurrencyText.Text = i
tweenService:Create(playerBoostFrame.CurrentBoost, TweenInfo.new(waitTime), {Size = UDim2.new(BAR_CHANGE_SIZE, 0, 1, 0)}):Play()
task.wait(waitTime)
if i == 0 then
for boost = boostTime, 0, -1 do
playerBoostFrame.CurrencyText.Text = boost
task.wait(waitTime)
end
end
end
end
end)()