Need help making a GUI scale according to a value

It gives me this

Is there any way to make it

(I want to show how much is left on the bottom, and what is used on the top)

tested at a value of 8000

Change the ValueChange function to this so that it’s set based on the remainder.

local function ValueChanged(Value:number)
	local Calculated = (maxFuel - math.min(Value, maxFuel)) / maxFuel
	
	TweenService:Create(script.Parent.Used, info, {Size = UDim2.fromScale(1, Calculated)}):Play()
end

If you have 3/4 of the max fuel in your “tank” then the fuel used is 1/4 and that’s what the frame is getting set to

1 Like

That works! Thank you very much!
Which post should I mark as the solution?

Probably the recent one because that gave results you were looking for

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