Help making a Confetti Kill Effect

  1. What do you want to achieve? Keep it simple and clear!

I want to achieve a simple confetti kill particle effect for my game. Every time the player dies, a confetti particle effect appears the moment he dies, and disappears shortly after.

https://images.app.goo.gl/cdjnZYkcyCeG3btQ7

  1. What is the issue? Include screenshots / videos if possible!

The issue is I have no clue if this effect is possible based on the given Roblox developer knowledge I have. The only way I could begin to think of doing this is having each player model have an attached ParticleEmitter that’s disabled/invisible, and upon death it turns it visible and then turns it off? How would I manage to script this so every player model in my game does this when they are in my server? I’m using custom character models for my game so am hoping this is possible

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

Tried searching on the forums but nothing similar comes up. Not sure if I should do it like a I mentioned above, or another entirely better way? Looking for any help possible

Well, the first thing you do is make a remote event in ReplicatedStorage and name it “DiedRE”.
And now, we have to make it so when the player dies, that functions fires the server. So in
StarterCharacterScripts, make a local script, and put this in:

script.Parent:WaitForChild(“Humanoid”).Died:Connect(function()

game.ReplicatedStorage.DiedRE:FireServer()
end)

Now you must add a script into ServerScriptService, and if you haven’t already, put the confetti effect in the script, and type this code into the script:

local ts = game:GetService(“TweenService”)
local fadeTI = TweenInfo.new(5, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)
local particlesTI = TweenInfo.new(2, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)

game.Players.PlayerAdded:Connect(function(plr)

plr.CharacterAdded:Connect(function(char)

  local humanoid = char:WaitForChild("Humanoid")

end)
end)

game.ReplicatedStorage.DiedRE.OnServerEvent:Connect(function(plr)

if not plr.Character or not plr.Character:FindFirstChild(“Humanoid”) then return end

local char = plr.Character
local humanoid = char.Humanoid

for i, d in pairs(char:GetDescendants()) do

  if d:IsA("BasePart") or d:IsA("Decal") then

  	spawn(function()


  		ts:Create(d, fadeTI, {Transparency = 1}):Play()


  		local particles = script.DeathParticles:Clone()
  		particles.Rate = 0

  		ts:Create(particles, particlesTI, {Rate = 100}):Play()

  		particles.Parent = d

  		wait(3)
  		ts:Create(particles, particlesTI, {Rate = 0}):Play()
  	end)
  end

end

wait(5)

plr:LoadCharacter()
end)

If there is any errors, send a screenshot.

2 Likes

Thank you so much! Code works great! However I was wondering, if I had a preset model of some ParticleEmitters that all-together create my confetti effect with my desired speed/size etc, how would I go on about doing it like this? Since this particular code animates and moves the particle inside the script.
Would my solution be that on PlayerDeath event the particle emitter attached to the character is set to visible?

If you need to, you can look at confetti particles models, and you might find something you like. And to adjust the particle, just go into properties and mess around for some stuff there. And for making it so it turns visible instead of giving it a rate, go to Line 31, and replace that text with this:

particles.Enabled = false

  		particles.Enabled = true

  		particles.Parent = d

  		wait(3)
  		particles.Enabled = false

Tell me if there is any errors.

1 Like