How to Destroy a ParticelEmitter

This script is disable tile the player moves and a script make this script enable. When the player stops the script is disabled but the ParticelEmitter is still enable. How do I destroy the ParticalEmitter?

2 Likes

Do you want it gone or just disabled?

If you want it gone then you’d use this

emitter:Destroy()

Otherwise you’d use this

emitter.Enabled = false

Where do I put it. Once the player stops moving the script stops

You’d put it before where you disable your script

This script destroy stops the script but when I try to destroy the Emitter an error pops up

Infinite yield possible on 'Workspace.Cyber_Designer:WaitForChild(“Lowertorso”)

local Run = game:GetService("RunService")
local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local SprintEffect = game.Players.LocalPlayer.PlayerScripts.SprintEffect

local StartedRunningTime: number

Humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
	if Humanoid.MoveDirection.Magnitude ~= 0 then
	Print("Code")
		end
	else
		Print("Code")
		local Torco = Character:WaitForChild("Lowertorso")
		Torco.Smoke:Destory()
		SprintEffect.Enabled = false
	end
end)

You forgot to capitalize the “T” in LowerTorso

Ok Thank I found the problem. Yes LowerTorso was misspelled but I missed spelled Destroy

I hate those minor spelling errors that are game breaking

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.