[USING R6 ANIMATIONS]
I have a button that, when touched by the player, attaches a particle effect to the player's torso.
However, when the player dies/respawns, the particles disappear. Is there any way to keep the particles attached to the player's torso, even after death?
My button script:
local Particles = script.Parent.Parent.ParticlesPart.ParticleEmitter script.Parent.Touched:connect(function(Part) local IsPar = Part.Parent.Torso:FindFirstChild("ParticleEmitter") if not IsPar then local particles = Particles:Clone() particles.Parent= Part.Parent.Torso else Part.Parent.Torso.ParticleEmitter:Destroy() local particles = Particles:Clone() particles.Parent= Part.Parent.Torso end end)
Thanks in advance, MexheCo
Torso
will be a child of the touching part's parent, when this is not always the case. You must do checks.local particles = script.Parent.Parent.ParticlesPart.ParticleEmitter script.Parent.Touched:Connect(function(part) -- Switch to :Connect, :connect is deprecated local charOrWS = part.Parent if charOrWS:FindFirstChild("HumanoidRootPart") then if not charOrWS.HumanoidRootPart:FindFirstChild("ParticleEmitter") then particles:Clone().Parent = charOrWs.HumanoidRootPart else print("user already has particles!") end end end)