Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I make my Battery Bar go the other way? (TweenSize)

I've got this monitor which shows my Battery levels and it like the Battery bar to go down, but it just goes the wrong way, it does this what I'm after is for it to go down instead of up.

Here's my code:

P.S I'm a complete noob to anything related to Tween.

workspace.Main.Battery:GetPropertyChangedSignal("Value"):Connect(function()
	local battery = workspace.Main.Battery.Value * 5.1 
	-- Battery is at 100 by default and can be drained by another source, and the multiply is to make the Value match up with the Bar size.
	workspace.Console.Monitor1.Movement.Screen.SurfaceGui.progressbattbar:TweenSize(UDim2.new(0, 120,0, battery),"InOut","Sine",6)
	print("Battery has changed.")
	
	
	-- Change color the lower the battery gets.
	if workspace.Main.Battery.Value > 50 then
		workspace.Console.Monitor1.Movement.Screen.SurfaceGui.progressbattbar.ImageColor3 = Color3.fromRGB(0, 255, 0)
	end

	if workspace.Main.Battery.Value <= 50 then
		workspace.Console.Monitor1.Movement.Screen.SurfaceGui.progressbattbar.ImageColor3 = Color3.fromRGB(255, 150, 0)
	end

	if workspace.Main.Battery.Value <= 25 then
		workspace.Console.Monitor1.Movement.Screen.SurfaceGui.progressbattbar.ImageColor3 = Color3.fromRGB(255, 0, 0)
	end
end)

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.