Progress bar for game not working?

The progress bar should work like a normal progress bar but for some reason the gradient is all over the place.

it should look something like this when the progress is increasing:
Screenshot 2025-09-21 162814

but for some reason it looks more like this:
Screenshot 2025-09-21 162918

video example of whats happening (in the video you can tell its increasing but its all janky):

the event fires from a module, heres the snippet:

for _, plr in genRepairState.repairingPlayers do
	signalProgressBar:FireClient(plr, genRepairState.repairProgress / 100, true)
end

and this is where the bar updates

local TweenService = game:GetService("TweenService") 
local event = game.ReplicatedStorage:WaitForChild("RemoteEvents"):WaitForChild("GuiEvents"):WaitForChild("SignalProgressBar") 
local ScreenGui = script.Parent local progressBar = ScreenGui:WaitForChild("Base"):WaitForChild("ImageLabel"):WaitForChild("ProgressBar") 
local gradient = progressBar:WaitForChild("UIGradient") 
local LastTarget = 0 

local lerp = function(a, b, t) 
	return a + (b - a) * t 
end 

event.OnClientEvent:Connect(function(alpha, show) 
	
	local Target = lerp(0, 1, alpha) 
	local proxy = Instance.new("NumberValue") 
	proxy.Value = LastTarget 
	
	proxy:GetPropertyChangedSignal("Value"):Connect(function() 
		
		local t = proxy.Value 
		local sequence 
		
		if Target > 0 and Target < 1 then 
			sequence = NumberSequence.new{ 
				NumberSequenceKeypoint.new(0, 0),
				NumberSequenceKeypoint.new(t, 0),
				NumberSequenceKeypoint.new(t + 0.00001, 1),
				NumberSequenceKeypoint.new(1, 1) } 
		else sequence = NumberSequence.new{ NumberSequenceKeypoint.new(0, 0), 
			NumberSequenceKeypoint.new(0 + 0.00001, 1), 
			NumberSequenceKeypoint.new(1, 1) } 
		end 
		
		gradient.Transparency = sequence
	end)
	
	if show then 
		proxy.Value = Target
	else 
		TweenService:Create(proxy, TweenInfo.new(0.2), {Value = Target}):Play() 
	end 
	
	LastTarget = Target
	
	if show ~= nil then 
		ScreenGui.Enabled = show
	end 
	
end)
1 Like

For client, only do

event.OnClientEvent:Connect(function(alpha, show) 
local sequence = NumberSequence.new{ 
				NumberSequenceKeypoint.new(0, 0),
				NumberSequenceKeypoint.new(alpha, 0),
				NumberSequenceKeypoint.new(alpha + 0.00001, 1),
				NumberSequenceKeypoint.new(1, 1) } 
end)

gradient.Transparency = sequence

the reason for this is given how your remote is fired, I infer that server did the tween already.

1 Like

its the decimal point precision, it should be 0.0001 not 0.00001

1 Like

oh that fixed it thanks! do you know the reason why that is how it is?

its just how it is with really small decimals, the uigradient just glitches out below three zeros

1 Like

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