Help with the emit function

I created this because my original post was in the wrong catagory.

I want to make a particle emitter emit a set amount of particles once. I was told to use the script (ParticleEmitter:Emit(25)) but I have no idea where to put it.

1 Like

You could simply add a localscript as a child of the the particle emitter and have the script say something like this:

local emitter = script.Parent
local numberToEmit = 25
emitter:Emit(numberToEmit)

Depends on if you want it to be client-based or server-based. If you only want a certain player to see it then client-based would be best, otherwise, you should use a server script.

If you’re doing this server-based, simply place a script inside of the emitter or in ServerScriptService.

  1. Create an object variable: local emitter = workspace.Part.ParticleEmitter
  2. Emit using emitter:Emit(25)

And that’s all you need!

Client-based works the same way, except you’ll need to place this all inside a LocalScript. You’ll also need to make sure the LocalScript is parented to a client service, I recommend placing it under StarterPlayerScripts under StarterPlayer.

So do i say emitter:Emit(25) in the command bar or what?

You place that line of code inside a localscript or normal script

Yeah but when I do it does nothing

Can you copy paste your code here to show me the full function?

Function? Whats that, I have no experience scripting