Particle emitter not working

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want to emit particles from a newly cloned object in server sided.

  2. What is the issue? The particle does not emit upon using :Emit().

  3. What solutions have you tried so far? Ive looked all over the hub, but i didnt see any similar problems. I tried waiting for one frame before emitting, but it does not work. For some reason, before i make this server sided, it was client sided. The particles emit just fine. Ive also checked the output, still nothing was wrong.

heres how it currently looks and how its supposed to look:


in this video, its consistent, but i want it to only emit once.

Heres the entirety of the script that clones the object and emits the particle, please dont mind if its messy, i barely have time to work on it and i will clean it up in the future:

game.ReplicatedStorage.Atk.OnServerEvent:Connect(function(plr,Atk,Folder,Mouse,hitP)
	if Atk == "LightBeam" then
		local dist = 1034
		
		local function CFramePointRightSide(pos, targetPos)
			local directionToFace = (targetPos - pos).unit
			local worldUp = Vector3.new(0,1,0)
			local zAxisFace = directionToFace:Cross(worldUp)
			local yAxisFace = directionToFace:Cross(zAxisFace)
			return CFrame.fromMatrix(pos, directionToFace, yAxisFace, -zAxisFace)
		end
		
		local object = workspace.Beams.Beam:Clone()
		object.Parent = workspace.Beams
		object.CFrame = CFrame.new(plr.Character.PrimaryPart.Position,hitP)
		local a = object.CFrame.LookVector
		object.CFrame = CFramePointRightSide(plr.Character.PrimaryPart.Position,hitP)
		object.CFrame = object.CFrame + a * dist
		local snd = Folder.shoot:Clone()
		snd.Parent = plr.Character
		snd:Destroy()
		
		task.wait()
		object.Explosion.ParticleEmitter:Emit(5)
		object.Explosion.Small:Emit(500)
		for i,v in object.Explosion2:GetChildren() do
			v:Emit(1)
		end
		for i,v in pairs(object:GetChildren()) do
			if v:IsA("SurfaceLight") then
				game.TweenService:Create(v, TweenInfo.new(4), {Brightness = 0, Range = 0}):Play()
			end
		end
		object.Transparency = -3
		game.TweenService:Create(object, TweenInfo.new(4), {Transparency = 1,Size = Vector3.new(2048,1,1)}):Play()
		game.Debris:AddItem(object,4)

		local sw1 = Folder.Shockwave:Clone()
		sw1.Parent = workspace
		sw1.CFrame = CFrame.new(plr.Character.PrimaryPart.Position,plr.Character.PrimaryPart.Position + object.CFrame.LookVector)
		game.Debris:AddItem(sw1,0.033333)

		local hrt = plr.Character.HumanoidRootPart
		
		local hum = hrt.Parent.Humanoid
		
		if hum.FloorMaterial ~= Enum.Material.Air then
			local sw2 = Folder.Shockwave2:Clone()
			sw2.Parent = workspace
			sw2.Orientation = Vector3.new(-90,math.random(-360,360),0)
			local Hpos = plr.Character.HumanoidRootPart.Position
			sw2.Position = Vector3.new(Hpos.X, sw2.Position.Y, Hpos.Z)
			game.TweenService:Create(sw2, TweenInfo.new(2,Enum.EasingStyle.Cubic), {Transparency = 1,Size = Vector3.new(100,100,10)}):Play()
			game.Debris:AddItem(sw2,2)
		end
		
		local touchingPart
		local istouching = false

		object.Touched:Connect(function(otherPart: BasePart) 
			if otherPart.Parent then
				if otherPart.Parent:FindFirstChild("Humanoid") then
					touchingPart = otherPart
					istouching = true
				end    
			end   
		end)

		object.TouchEnded:Connect(function(otherPart: BasePart) 
			if otherPart.Parent then
				if otherPart.Parent:FindFirstChild("Humanoid") then
					touchingPart = nil
					istouching = false
				end    
			end
		end)

		local function touched()
			if touchingPart then
				if touchingPart.Parent:FindFirstChild("Humanoid") and istouching then
					if touchingPart.Parent.Name ~= plr.Character.Name then
						touchingPart.Parent.Humanoid:TakeDamage(10)
						local a = Instance.new("ForceField",touchingPart.Parent)
						if touchingPart.Parent:FindFirstChild("ForceField") then
							a:Destroy()
						else
							game.Debris:AddItem(a,4)
						end
					end
				end   
			end
		end

		game["Run Service"].Heartbeat:Connect(touched)
	end
end)```
3 Likes

Have you tried to change task.wait() to wait() ?
Maybe because task.wait() is a little bit fast

3 Likes

By manual mean, you perhaps need to check the cond(if statement) and make sure to use print() on each if statement to see which is fullfilled!

if 1 + 1 == 2 then
   print("This statment is true!")
   if 2 + 2 == 4 then
      print("This statement is also true!!!")
   end
end

im sorry, but the emitting part does not require any conditions.

		object.Explosion.Small:Emit(500)
		for i,v in object.Explosion2:GetChildren() do
			v:Emit(1)
		end

for some reason the reply was broken. Idk why that happened

UPDATE

Ive debugged and the problem is that i cannot see it in client. I switched to server camera and i see the particles. I will try firing a message to every client and see if it works.

yeah it did not work. Can anyone help me think of a solution?

Thank you! I doubted this would work at first. Heres the full story:

At first, i thought that waiting more wouldnt work. I tried to think of solutions for a while. Then, i had to give up. When i was developing the game, i thought the beam was too op and nobody can predict it, so i added an indicator, waiting for one second. After playtesting, the particles suddenly appears.

1 Like

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