I have a custom GUI that displays a player's health via a bar. As the player's health is damaged, the bar is supposed to gradually change colors from green to red. However, when the bar reaches halfway, I want the bar to show a much brighter yellow. With this script. the bar is only a brownish yellow at the halfway point. How can I accomplish this?
This is my script:
while wait(.1) do
local player = game.Players.LocalPlayer
local human = player.Character.Humanoid
local health = human.Health
local maxHealth = human.MaxHealth
local ratio = health/maxHealth
script.Parent.BackgroundColor3 = Color3.new(1-ratio, ratio, 0)
end
Any help is appreciated!
