local maxvalue = script.Parent.MAXVALUE
local fillbackground = script.Parent.FILLBACKGROUND
local fill = fillbackground.FILLL
local runservice = game:GetService("RunService")
runservice.RenderStepped:Connect(function()
local division = currentvalue.Value / maxvalue.Value
fill.Size = UDim2.fromOffset(0, division)
end)
division will be a value between 0 and 1. Because of this, I assume you want to use scale instead of offset. Additionally, you need to give it a size in the X direction instead of just saying 0
local maxvalue = script.Parent.MAXVALUE
local fillbackground = script.Parent.FILLBACKGROUND
local fill = fillbackground.FILLL
local runservice = game:GetService("RunService")
runservice.RenderStepped:Connect(function()
local division = currentvalue.Value / maxvalue.Value
fill.Size = UDim2.fromScale(.8, division)
end)
Also, you should look at using .Changed:Connect(function() … end) instead of using RenderStepped - it’ll be a lot more performant
Well how do you have it set up in explorer? Is the white bar a child of the black bar? If not, and its contained within the same parent, then the final height should be the height of the black bar. You can reduce it slightly if you don’t want it going all the way
then you don’t need to multiply it.
Just have the size as
UDim2.fromScale(1, division) and modify the anchor point until it starts at the very bottom.