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

Check if number goes below 70?

Asked by 3 years ago

So im trying to change the color of a text labe if the health of the humanoid goes below 70

The script: (its a script not localscript)

local Humanoid = script.Parent.Humanoid
local HealthGui = script.Parent.Head.BillboardGui.Health

HealthGui.Text = ""..Humanoid.Health
Humanoid.HealthChanged:Connect(function()
    HealthGui.Text = ""..Humanoid.Health
end)

if Humanoid.Health < 70 then
    HealthGui.TextColor3 = Color3.new(1, 1, 0)
end

1 answer

Log in to vote
1
Answered by 3 years ago

Move lines 9 to 11 inside the HealthChanged function.

Ad

Answer this question