Confetti Death Effect?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    I want to create a simple confetti/particle death effect when a player gets killed. It would be just a simple confetti like animation that appears for a few seconds then disappears. This is the closest representation: https://static.wikia.nocookie.net/robloxarsenal/images/0/0c/Conffeti.gif/revision/latest/scale-to-width-down/245?cb=20210116063055
  2. What is the issue? Include screenshots / videos if possible!
    My issue is I have no clue how I would go on about doing this. I am not sure if I should attach the particleEmitter/confetti effect to the player character models, and if a player dies the confetti/particles are set to “Active” or “Visible” for a few seconds, then back to visible. However I am not sure if this is correct or even possible.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried to think of ways of doing this but am not sure if Roblox allows for certain ways, or whether certain ways are better then another method.
2 Likes

Use a Humanoid.Died event and create a particle effect via Instance.new (set the position to the character’s position)

1 Like

What’s the easiest way of getting the character’s position?

Should all this confetti death effect handling be put into a local StarterCharacterScript or a server script?

You can do it in StarterCharacterScripts.
For getting the characters position:

Inside the died function, create a variable that gets the cframe of the HumanoidRootPart of the character, or you can adjust it to have a position you want.

–Died function–
local position = script.Parent.HumanoidRootPart.Position

1 Like

Thank you for your quick replies!
I have been able to get a very scuffed version going. The idea and concept is there, although I am not sure this is the most efficient way possible. I wrote this all in a server script because I assumed if I handled all this locally, only the local player will be able to see the confetti when a player gets killed? At least this is how I understood it.

game:GetService(‘Players’).PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild(“Humanoid”).Died:Connect(function()
local position = character.HumanoidRootPart.Position
local storage = game:GetService(“ReplicatedStorage”)

		local confetti = storage.Part 
		 
		local newconfetti = confetti:Clone()
		newconfetti.Parent = workspace 
		newconfetti.Position = position 
		wait(2)
		newconfetti:Destroy() 
	end)
end)

end)

So I should handle the character Died event locally in the script, and then spawn in the new confetti all in a local script? This will not cause issues like only the client will be able to see their particle effect since its all local

1 Like

If you’re wanting to handle that script client-sided (Or that only you can see it), make it into a LocalScript, otherwise it should work fine if you put it as a Server Script inside ServerScriptService

Ok thank you, and no definitely want it to be server sided so everyone can see it, not just the client. In this case I assume I would need to create the server side script like above, but what would happen if I wanted to make death effects purchasable? Would I then need to handle some stuff locally and some stuff server sided? Because some character models would have different effects upon death then others, so would this have to be handled locally and then be used with a RemoteEvent and handled in a server script? Am very confused

Yeah, you can look at MarketplaceService’s functions which would prompt the death effect you’d like to purchase, then you can handle when the Player has finished the Gamepass Status via the PromptProduct/Gamepass/PurchaseFinished Events

I don’t think you’ll need to set up a RemoteEvent to detect when the Player has purchased a gamepass, as these Events are replicated