How do i use :Emit() on a remote event?

im trying to make a remote event where it will clone a part and emit all the partciles inside of it, but it does nothing, the part is being cloned, and i can manually emit the particle using a pluging, but the code isnt emiting

local skill = game.ReplicatedStorage.Skills.Wind

local event = skill.Fskill.RemoteEvent
local debris = game:GetService("Debris")
local runservice = game:GetService("RunService")

event.OnServerEvent:Connect(function(player)
	
	local character = player.Character
	local root = player.Character:FindFirstChild("HumanoidRootPart")
	
	local mark = skill.Fskill.Dash:Clone()
	mark.Parent = workspace.Ignore
	mark.CFrame = root.CFrame - Vector3.new(0, 1, 0) 
	
	local function onStep()
		for i, v in mark:GetDescendants() do 
			if v:IsA("ParticleEmitter") then
				local emition = tonumber(v:GetAttribute("EmitCount"))
				print(emition)
				print(v.Name)
				v:Emit(emition)	
			end
		end		
	end
	onStep()
	debris:AddItem(mark, 10)

this is just part of the script, thats why doesnt have “end)” at the end

i already tried to put a number on the :emit(), but it also does nothing

:emit() is a client-sided function.
it must be used in a local script

oh, is there a way or another alternative to do it on normal script?

nope, if you want it to show for everyone use a local script and remote event and use RemoteEvent:FireAllClients()

No, :Emit() works on the server. It can be used just fine in a server sided script. That’s not the issue here.

@DestruidorDNC what does the output look like in the console? Also make sure the particles aren’t transparent.

1 Like

image
its fine, its showing the values and the names, the particles are enabled and also not transparent

here is the hole script if u want to see if there is any other error there

local skill = game.ReplicatedStorage.Skills.Wind

local event = skill.Fskill.RemoteEvent
local debris = game:GetService("Debris")
local runservice = game:GetService("RunService")

event.OnServerEvent:Connect(function(player)
	
	local character = player.Character
	local root = player.Character:FindFirstChild("HumanoidRootPart")
	
	local mark = skill.Fskill.Dash:Clone()
	mark.Parent = workspace.Ignore
	mark.CFrame = root.CFrame - Vector3.new(0, 1, 0) 
	
	local function onStep()
		for i, v in mark:GetDescendants() do 
			if v:IsA("ParticleEmitter") then
				local emition = tonumber(v:GetAttribute("EmitCount"))
				print(emition)
				print(v.Name)
				v:Emit(emition)	
			end
		end		
	end
	onStep()
	debris:AddItem(mark, 10)
	
	local speed = Vector3.new(100, 70, 100)
	local force = 100000
	
	local dash = Instance.new("BodyVelocity")
	dash.Parent = root
	dash.Name = "Dash"
	
	local direction = root.CFrame.LookVector + Vector3.new(0, 1, 0)	
	dash.MaxForce = Vector3.new(force, force, force)
	dash.Velocity = direction * speed
	debris:AddItem(dash, 0.1)
	
	local humanoid = character.Humanoid
	local animation = Instance.new("Animation")
	animation.AnimationId = "rbxassetid://17436039258"
	animation.Parent = character 
	local animationgo = humanoid:LoadAnimation(animation)
	animationgo.Priority = Enum.AnimationPriority.Action
	animationgo.Looped = false
	animationgo:Play()
	debris:AddItem(animation, 5)
end)

I’m still looking through your code, in the meantime can you make sure that mark is in the correct position and make sure that the particles aren’t transparent? I’m trying to reproduce this bug myself but haven’t yet

1 Like

tysm for the help, the mark is really on the correct position and also not transparent

robloxapp-20240510-0022451.wmv (880.0 KB)

on the video u can see that it only do the dash, the particle dont show, but when i use the plugin manually it goes

Who told you that :Emit() is a client-sided function? Please do proper research, you’re spreading misinformation here.

@DestruidorDNC
As for OP, does manually enabling it i.e setting v.Enabled = true work or not?

Also, OP, there is no need to use a function if you will call it only once, remove the onStep function.

1 Like

still not working, even when i remove the function

Does it emit if you use .Enabled? Only other thing I can think of would be the particles being parented wrong or something about the particles getting stuck at like 0,0,0, but I don’t think that’s the case as whatever plugin you’re using seems to work fine

1 Like

Removing the function wasn’t my attempt for the solution, it was a suggestion for code cleanliness. My attempted solution was by trying particleEmitter.Enabled = true.

1 Like

i also did this, but still not working

Okay, so you use particleEmitter.Enabled and it didn’t work, first of all, may I know your graphics level? Also can I know how long did you have the emitter on for? This can be a bug with your graphics level as if you are using a graphics level of 1 then (almost) no particle emitter would work.

1 Like

i think the problem isnt like its stuck on 0,0,0 because when i do the dash in the air it also shows nothing, and the .enable is already on but still not working :cry:

On the video my graphic lvl is 5, when i change to max it shows no changes.
The emitter is on the world for 10 seconds, the lifetime of the particles are like 0.5, but i still can see normaly, if i do the particles live longer it changes nothing

I see, this is quite an odd case? Try doing this with a default roblox particle emitter with your set lifetime of 0.5 to see if its an issue with all particle emitters or not. It could be that the particle emitters image takes time to load?

1 Like

Emitting right after the mark clone is Parented doesn’t provide clients enough time to receive those parts before the instruction to emit particles arrives. This is affected by client ping and the server would have to considerably delay the :Emit() in hope that clients have received the mark in time. You should probably handle the emission on clients in this case. You can still parent it and keep the other stuff, just make clients simulate the emissions for themselves once they notice a relevant model of ParticleEmitters (like mark) appearing under the Workspace.Ignore Instance you’ve set up.

3 Likes