Gui sized to value?

Im tweaking the roblox car system and adding gas to it, but the sizing is all messed up for the bar that shows your fuel, i set the fuel at 5000 and the gas sizes itself to that, how would


||local gas = engine:GetAttribute(Constants.ENGINE_GAS_ATTRIBUTE)|
|---|---|
||gui.Speedometer.GasFrame.Gas.Bar.Size = UDim2.fromScale(gas * 1/gas, 1)|

this is whats sizing it, like I said i have it set at 5000 for fuel value

im not sure what the problem is, but there is a really easy tutorial for custom bars right here

1 Like

basically with the gas being at 5000, it wants to set the size of x on the bar to 5000, making it not show it deplition when driving

ohhh okkkkk, hmm. i would still follow the tutorial its just a few lines of code. it has exaclty what you need.

I’m pretty sure that you would want to do (Gas/MaxGas) * MaxBarSize

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