Trying to get a Kill Effect

Hello! I’m new to this, I wanted to try out a new kill system, (or however you’d like to say it) which whenever you kill someone, particles fly out, for example:

image
image

(Bad example, I get it)

Here’s my current, very simple (and not working) script:

local plr = game.Players.LocalPlayer
local Character = plr.Character

Character.Humanoid.Health = 0 then
	script.Parent.ParticleEmitter.Parent = Character:FindFirstChild("Humanoid")
end

I’m super new to this, I’m sorry if this looks like a joke.
Thank you! :smile:

2 Likes

You need an event here so you know when the player dies. Thankfully, they have a specific one just for this occasion!

local plr = game.Players.LocalPlayer
local Character = plr.Character

Character.Humanoid.Died:Connect(function()
	script.Parent.ParticleEmitter.Parent = Character:FindFirstChild("HumanoidRootPart") --Edited for hrp
end)

I’m sure that’ll work now, thank you so much!! I’ll tell you if there’s any problems :grinning:

1 Like

Just realized you are parenting to the Humanoid right now which won’t show the particle. You can parent it to a part instead like this:

local plr = game.Players.LocalPlayer
local Character = plr.Character

Character.Humanoid.Died:Connect(function()
	script.Parent.ParticleEmitter.Parent = Character:FindFirstChild("HumanoidRootPart")
end)