Fade to red depending on the value

I’m not all that into scripting I’m still learning a lot about Lua.
I’m trying to achieve an effect like this, But I don’t know how to.

image
image
image
image

I’m guessing you mean for a health bar on a GUI?

Try the Search bar up top. I found this post using it: How to add Color3 tweening to this Health Bar UI - #6 by HayHaySun2

1 Like

Doesnt seem to work right…
image

value = script.Parent
value:GetPropertyChangedSignal("Value"):Connect(function()
	print("%" .. value.Value)
	script.Parent.Parent.Text = ("%" .. value.Value)
	local hp = math.clamp(value.Value/value.Value,0,1)
	local bar = script.Parent.Parent.Parent
	game:GetService("TweenService"):Create(
	bar,

	TweenInfo.new(
		0.1,
		Enum.EasingStyle.Quad
	),
	{
		BackgroundColor3 = Color3.fromHSV(hp/3,1,1),
	}
	):Play()
end)

local hp = math.clamp(value.Value/100,0,1)

1 Like