Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with health bar?

Asked by 8 years ago

i need some help With this custom Health bar something went wrong i do not know what help me

local Char = workspace:FindFirstChild(script.Parent.Parent.Parent.Character)
hum = Char.Humanoide
hum.Changed:connect(function()
    script.Parent.Frame.Health.Frame.Size = Udim2.new(hum.Health/hum.MaxHealth,0,1,0)
    script.Parent.Frame.potet.TextLabel.Text = ""..hum.Health.."/"..hum.MaxHealth..""
    if hum.Health <= hum.MaxHealth*0.15 then
        script.Parent.Frame.Health.Frame.BackgroundColor3 = Color3.new = (139,0,0)
    else
        script.Parent.Frame.Health.Frame.BackgroundColor3 = Color3.new = (213,5,5)

    end
end)

0
Output? F9? Nickoakz 231 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago
local Char = workspace:FindFirstChild(script.Parent.Parent.Parent.Character)
hum = Char.Humanoide
hum.Changed:connect(function()
    script.Parent.Frame.Health.Frame.Size = Udim2.new(hum.Health/hum.MaxHealth,0,1,0)
    script.Parent.Frame.potet.TextLabel.Text = ""..hum.Health.."/"..hum.MaxHealth..""
    if hum.Health <= hum.MaxHealth*0.15 then
        script.Parent.Frame.Health.Frame.BackgroundColor3 = Color3.new (139,0,0)--incorrect format
    else
        script.Parent.Frame.Health.Frame.BackgroundColor3 = Color3.new(213,5,5)--incorrect format

    end
end)

0
Explain the problem, also Color3's need to be in decimals so divide the values by 255. M39a9am3R 3210 — 8y
Ad

Answer this question