This script is inside the Humanoid of the Zombie, when the health of the Zombie is 0 it should enable the particles for 5 seconds. (The ParticleEmitter is inside the torso)
local emitter = script.Parent.Torso.ParticleEmitter local starter = script.Parent if starter.Health == 0 then emitter.Enabled = true wait(5) emitter.Enabled = false end
You're only checking if the Health is 0 once. You need to use either a loop or more preferably, an event, to make sure it keeps checking if the health is 0.
local emitter = script.Parent.Torso.ParticleEmitter local starter = script.Parent starter.HealthChanged:connect(function(health) --Anonymous function which fires every time the player's health changes. The health parameter is how much health the humanoid is at now, if health ~= 0 then return end --If the player isn't dead, stop the function. emitter.Enabled = true wait(5) emitter.Enabled = false end) --Closing parenthesis to wrap the function in the connection to the event.
I hope my answer helped you. If it did, be sure to accept it.