✓ Accepted answer
What you should do is use an event called HealthChanged.
HealthChange is an event from the Humanoid that detects whenever the health of the humanoid, well, changes.
local humanoid = script.Parent.Humanoid
humanoid.HealthChanged:Connect(function(newHealth)
if newHealth <= 50 then
script.Parent.Torso.ParticleEmitter.Enabled = true
else
script.Parent.Torso.ParticleEmitter.Enabled = false
end
end)
What the script does is that whenever the health of the humanoid changes, it detects whether if the health is lower than 50, it it is, it will enable the particle emmiter.
I also assume that once the humanoid's health is greater than 50, you would want the particle emitter to disable itself, but if you don't want it to, just delete the else part of the if-statement.
4 comments
if you have any questions on how runService works ask me
RBXSignals are basically checks that runs every frame which is what ArsonMcFlames did
Nah, don't use this way. Just use .HealthChanged() to detect when the humanoid's health changes. I'm pretty sure the way you're suggesting would bog down the game if many scripts of this type were added into a single game.
thanks to both of you!