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.
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.
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
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
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