script.Parent represents the healthbar
local player = game.Players.LocalPlayers
while true do
hel = player.Character.Humanoid.Health
if hel <= 25 then
script.Parent.Size = UDim2.new(hel*0.006,0,0.400000006,0)
script.Parent.Text = hel
script.Parent.BackgroundColor = BrickColor.new ("Bright red")
else
script.Parent.Size = UDim2.new(hel*0.006,0,0.400000006,0)
script.Parent.Text = hel
script.Parent.BackgroundColor = BrickColor.new ("Bright green")
end
wait()
end
|