Hi, I have a Overhead health gui that allows people on the server to see the amount of health you have. I have a script named "OverheadGuiScript" which is a normal script in StarterCharacterScript and a billboard gui named 'HealthGui' in it as a child. Under the healthgui there is a frame called Background and a text label called 'Indicator'. Under Background is a frame called 'Health'. The problem is that the health bar is not going down and the indicator is not changing at all. Please help.
OverheadGuiScript:
local char = script.Parent
local humanoid = char:FindFirstChild('Humanoid')
local healthGui = script.HealthGui
healthGui.Parent = char.Head
humanoid.HealthChanged:Connect(function()
local healthColor = Color3.fromRGB(255,0,0):Lerp(Color3.fromRGB(85,255,0),humanoid.Health/humanoid.MaxHealth)
local healthChange = humanoid.Health/humanoid.MaxHealth
healthGui.Background.Health:TweenSize(UDim2.new(healthChange,0,1,0),"In","Linear",1)
healthGui.Background.Health.BackgroundColor3 = healthColor
healthGui.Background.Health.Indicator.Text = "Health: ".. math.floor(humanoid.Health).."/"..(humanoid.MaxHealth)
end)

2 comments
How are you applying the damage to test if it's working?
by setting my health to 50 in the humanoid of my character