You would put this on as one of the scripts for a health GUI right?
local char = workspace:findFirstChild(script.Parent.Parent.Parent.Name)
hum = char.Humanoid
hum.Changed:connect(function()
script.Parent.Frame.Health.Frame.Size = UDim2.new(hum.Health/hum.MaxHealth,0,1,0)
if hum.Health <= hum.MaxHealth*0.15 then
script.Parent.Frame.Health.Frame.BackgroundColor3 = Color3.new(150,0,0)
else
script.Parent.Frame.Health.Frame.BackgroundColor3 = Color3.new(0,170,0)
end
end)

1 comment
This is a script for a health gui, yes. Make sure you have the necessary requirements before attempting to use it.