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

How do I make this cooldown bar work by subtracting continuously a value?

Asked by 4 years ago
Edited 4 years ago
for i = 0, 10 do
            game.StarterGui.Cloaking.Frame.CloakingTime.Size.Y = game.StarterGui.Cloaking.Frame.CloakingTime.Size.Y - (0; 18)
wait(1)
    end

Well, I don't know how to subtract from UDim2.

1 answer

Log in to vote
0
Answered by 4 years ago

Try this

game.StarterGui.Cloaking.Frame.CloakingTime.Size=UDim2.new(0,0,0,game.StarterGui.Cloaking.Frame.CloakingTime.Size.Y.Offset-i)
0
oh also to make the cooldown appear smooth change wait(1) to wait(0.1) and change i=0,10 to i=0,10,0.1 elitekiller2342 87 — 4y
0
it didn't work for me, the gui hasn't changed ArcanZus 61 — 4y
0
Actually it is changing the size of the gui but it keeps the same I don't know why ArcanZus 61 — 4y
0
What do you mean it keeps the same??? elitekiller2342 87 — 4y
0
Well, when I look at the value of the size it is decreasing, but the bar continues the same size ArcanZus 61 — 4y
Ad

Answer this question