I can’t see any problems with this script but the text just isn’t syncing with the humanoid’s health. I have checked the ouput which has no errrors whatsoever.
I tried changing
humanoid.Health.Value
to
humanoid.Health
but that didn’t work either.
--//By shish_kebab3
--//Variables\\--
local beast = script.Parent
local head = beast:WaitForChild("Head")
local humanoid = beast:WaitForChild("Humanoid")
local gui = head:WaitForChild("BillboardGui")
local frame = gui:WaitForChild("Frame")
local healthLabel frame:WaitForChild("Health")
--//Functions\\--
local function update()
healthLabel.Text = humanoid.Health.Value.."/"..humanoid.MaxHealth.Value
if humanoid.Health <= 7500 then
healthLabel.TextColor3 = Color3.fromRGB(255, 170, 0)
healthLabel.TextStrokeColor3 = Color3.fromRGB(99, 66, 0)
elseif humanoid.Health <= 5000 then
healthLabel.TextColor3 = Color3.fromRGB(170, 85, 0)
healthLabel.TextStrokeColor3 = Color3.fromRGB(125, 62, 0)
elseif humanoid.Health <= 2500 then
healthLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
healthLabel.TextStrokeColor3 = Color3.fromRGB(125, 0, 0)
end
end
humanoid.HealthChanged:connect(function()
update()
end)
You’re trying to access a property of a property, which isn’t possible. Change this to just humanoid.Health and change humanoid.MaxHealth.Value to humanoid.MaxHealth
The Connect method takes a function as a parameter. You can pass an anonymous function (:Connect(function() end)) or passing a function that already exists (without calling it!! :Connect(myFunctionHere)).