✓ Accepted answer
To make a brick with a health bar:
- Create a model in workspace
- Add a part to the model and name it "Head"
- Add a Humanoid to the model
- Add a smoke object to the part named Head. Disable the smoke.
- Add a script to the model
Inside the script, add this code:
local humanoid = script.Parent.Humanoid
local smoke = script.Parent.Head.Smoke
humanoid.HealthChanged:connect(function(health)
smoke.Enabled = health <= 50
end)
[Edit]
I modified the logic in the script a little bit so that if the health of the humanoid increases above 50 (via a health regen script or something) then it will stop smoking.
Have fun!
1 comment
Please help anything is great