Is it possible to devide the size of a GUI?

Hi i want to make a rank progress bar with XP but i want to make it simple to setup.
And i want the progress bar to be smooth and for that i need to devide the GUI size with the XP value needed for the next rank.
The gui:

(I am Dutch so my English can be bad c:)

using scale its best option
Basically 0 - means empty bar, 1 means - full bar
take a max Xp value and current one and devide them
Example MaxXP/MaxXP = 1; 50/100 = 0.5; 23/100 = 0.23 and etc, simple math tho
Then you can use TweenService or tweensize with new values

XPBarFrame:TweenSize(
	UDim2.fromScale(CurrentXP/MaxXP, 0),  -- endSize (required)
	Enum.EasingDirection.Out,    -- easingDirection (default Out)
	Enum.EasingStyle.Sine,      -- easingStyle (default Quad)
	0.25,                          -- time (default: 1)
	true,                       -- should this tween override ones in-progress? (default: false)
)
1 Like