Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

Try this

game.StarterGui.Cloaking.Frame.CloakingTime.Size=UDim2.new(0,0,0,game.StarterGui.Cloaking.Frame.CloakingTime.Size.Y.Offset-i)

5 comments

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

0

it didn't work for me, the gui hasn't changed

0

Actually it is changing the size of the gui but it keeps the same I don't know why

0

What do you mean it keeps the same???

0

Well, when I look at the value of the size it is decreasing, but the bar continues the same size

This discussion is preserved as it was. New answers, comments, and votes are closed.