Problem with particles

Hello developers, today i was trying to make a fruit from the one piece anime and i got this “error”:

The problem is that only one person gets the particles.

This is the entire code:

-- // Variables \\ --

local RemoteEvent = script.Parent

local TweenService = game:GetService("TweenService")

local Debris = game:GetService("Debris")

local Debounce = false

-------------------------

RemoteEvent.OnServerEvent:Connect(function(player,AbilityModule)
	
	-- // Variables 
	
	local Character = player.Character
	
	local Humanoid = Character:WaitForChild("Humanoid")
	
	local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
	
	local Animation = Instance.new("Animation")
	
	Animation.AnimationId = "http://www.roblox.com/asset/?id=9415232132"
	
	local AnimationTrack = Humanoid:LoadAnimation(Animation)
	
	local ExplosionSound = script.Parent.Sounds.ExplosionSound:Clone()
	
	-------------------------------------------------
	
	-- // Function
	if Debounce == false then
		
		Debounce = true
		
		local MagmaModel = script.Parent.VFX.Magma:Clone()
		MagmaModel.Parent = HumanoidRootPart
		MagmaModel.CFrame = HumanoidRootPart.CFrame * CFrame.new(0,-2.5,0)
		
		
		local TweenInfo = TweenInfo.new(
			0.5,
			Enum.EasingStyle.Quad,
			Enum.EasingDirection.InOut,
			0,
			false,
			0
		)

		local TweenGoal = {
			Size = Vector3.new(28.372, 1.484, 29.186),
			Orientation = MagmaModel.Orientation + Vector3.new(0,50,0)
		}
		
		local TweenGoal2 = {
			Size = Vector3.new(0,0,0)
		}

		local TweenAnimation = TweenService:Create(MagmaModel,TweenInfo,TweenGoal)
		TweenAnimation:Play()
		ExplosionSound.Parent = HumanoidRootPart
		ExplosionSound:Play()
		
		local TweenAnimation2 = TweenService:Create(MagmaModel, TweenInfo, TweenGoal2)
		
		TweenAnimation.Completed:Connect(function()
			wait(2)
			TweenAnimation2:Play()
			ExplosionSound:Destroy()
		end)
		
		TweenAnimation2.Completed:Connect(function()
			Debris:AddItem(MagmaModel,0.1)
		end)
		
		local HitDebounce = {}
		
		local MagmaHitbox = Instance.new("Part",MagmaModel)
		MagmaHitbox.Transparency = 1
		MagmaHitbox.Size = Vector3.new(28.372, 1.484, 29.186)
		MagmaHitbox.CanCollide = false
		MagmaHitbox.CFrame = MagmaModel.CFrame
		
		
		local FireParticles = script.Parent.Particles.FireParticles:Clone()
		
		local FireSound = script.Parent.Sounds.FireSound:Clone()
		
		MagmaHitbox.Touched:Connect(function(hit)
			if hit.Parent ~= Character then
				if hit.Parent:FindFirstChild("Humanoid") then
					if not HitDebounce[hit.Parent] then
						HitDebounce[hit.Parent] = true
						
						local TargetHRP = hit.Parent:FindFirstChild("HumanoidRootPart")
						
						hit.Parent:FindFirstChild("Humanoid"):TakeDamage(AbilityModule.Damage)
						
						TargetHRP.CFrame = CFrame.new(TargetHRP.Position,HumanoidRootPart.Position)
						
						local EndPositionOfKnockBack = TargetHRP.CFrame * CFrame.new(0,3,10)
						
						local BodyPosition = Instance.new("BodyPosition",TargetHRP)
						
						BodyPosition.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
						BodyPosition.Position = EndPositionOfKnockBack.p
						BodyPosition.D = 100
						BodyPosition.P = 600
						
						Debris:AddItem(BodyPosition,0.5)
						
						FireParticles.Parent = hit.Parent:FindFirstChild("Torso")
						FireSound.Parent = hit.Parent:FindFirstChild("Torso")
						FireSound:Play()
						
						for i = 1,4,1 do
							hit.Parent:FindFirstChild("Humanoid"):TakeDamage(AbilityModule.FireDamage)
							wait(1)
						end
						
						if not FireParticles then return end
						
						hit.Parent:FindFirstChild("Torso").FireParticles:Destroy()
						
						hit.Parent:FindFirstChild("Torso").FireSound:Destroy()
				
						wait(2)
						
						HitDebounce[hit.Parent] = false
					end
				end
			end
		end)

If you need more info, tell me :slight_smile:

I don’t know if this is the problem but even though I don’t see where FireParticles are being removed, you have the FireParticles being cloned only once before the Touched event. You should move the variable within the Touched event so it can make a new clone of the particles every time the event fires. Your snippet moves the singular clone to the torso.

1 Like

The problem is that you only make one “FireParticles”. You need to clone it when you detect the touched dummy. @HeyWhatsHisFace beat me to it

1 Like

Whoops. I see it now.
hit.Parent:FindFirstChild("Torso").FireParticles:Destroy()

Thank you guys,the two posts helped me a lot, hehe (i also got another problem which i’m going to publish right now)