How do i make a brick have health and when the health is about 50% a smoke inside the brick is enabled?? I know how to enable the smoke but i don't know how to make it so it enabls it when the health is at a certain number. This is for a engine that can smoke if it takes damage.
Please help thanks.
To make a brick with a health bar:
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!