Every time a character dies, the particle emitter is being removed, what should I do to keep the particle emitter in the character until it's unequiped by a player?
on = false Player = game.Players.LocalPlayer Cost = 1 Coins = Player.leaderstats.Coins script.Parent.MouseButton1Click:connect(function() if on == true then script.Parent.Parent.Parent.Parent.Parent.Character.Torso.ParticleEmitter.Parent = nil on = false script.Parent.Text = "Disabled" elseif on == false and Coins.Value >= Cost then local e = script.ParticleEmitter:Clone() e.Parent = script.Parent.Parent.Parent.Parent.Parent.Character.Torso script.Parent.Text = "Enabled" on = true end end)
on = false Player = game.Players.LocalPlayer Cost = 1 Coins = Player.leaderstats.Coins script.Parent.MouseButton1Click:connect(function() if on == true then Player.Character.Torso.ParticleEmitter:Destroy() on = false script.Parent.Text = "Disabled" elseif on == false and Coins.Value >= Cost then local e = script.ParticleEmitter:Clone() e.Parent = Player.Character.Torso script.Parent.Text = "Enabled" on = true end end) Player.CharacterAdded:Connect(function (char) if on == true then local e = script.ParticleEmitter:Clone() e.Parent = char.Torso end end)
Just added some lines into script, I hadn't tested but it should work.