Skip to content

Starting, stopping and waiting

This page covers the calls that keep an effect running, stop it, and change it while it runs. Part_Icles:Activate() and Part_Icles:Deactivate() are on Getting the module into a script.

On this page a stock emitter is a ParticleEmitter, Trail or Beam that the plugin has not transformed. A container is a Folder, Model, Part or Attachment that holds emitters.

CallitemWhat it does
Part_Icles:Enable(item, link?, duration?)One emitterStreams particles at the emitter’s Rate, for duration seconds. With no duration the stream has no end.
Part_Icles:AbsoluteEnable(item)An emitter, a stock emitter or a containerSwitches everything in item on and leaves it on.

Enable streams only while the emitter’s Enabled is on. With Enabled off, the call stops at once and makes nothing.

SubjectBehaviour
RateRead on every frame. A Rate of 0 or less makes nothing.
Emit count, DelayNot used. There is no burst and no wait.
The stream ends whenduration has passed, Enabled goes off, the emitter is removed, or a stop call is made.
A second Enable on the same emitterIt replaces the first.
An Animate emitterLoop is switched on and the cycle starts. Enabled is not consulted.
An instance that is not an emitterNothing happens.

link is as on Firing an effect.

AbsoluteEnable does not use the Emit count, Delay or Duration of anything.

Inside itemWhat happens
An emitter in Emit modeIts Enabled is switched on. It streams at its Rate with no end.
An Animate emitterIts Loop is switched on. The cycle starts.
A stock ParticleEmitter, Trail or BeamIts Enabled is set to true.

The CAUTION under What “Absolute” means applies to AbsoluteEnable, AbsoluteDisable and the two Absolute timescale calls.

A hard stop removes every particle at once. A soft stop makes no more particles and lets those in flight finish.

ToCall
Stop one emitter and let its particles finishPart_Icles:SoftDisable(emitter)
Stop a whole effect and let its particles finishPart_Icles:AbsoluteDisable(container)
Stop one play of an EmitAt call and let its particles finishhandle:SoftDisable()
Remove an emitter’s particles nowPart_Icles:Disable(emitter)
Remove a whole effect’s particles nowPart_Icles:Disable(container)
Remove one play’s particles nowhandle:Disable()
Stop the whole modulePart_Icles:Deactivate()
CallitemKind of stop
Part_Icles:Disable(item)An emitter or a containerHard
Part_Icles:SoftDisable(item)An emitter or a containerSoft
Part_Icles:AbsoluteDisable(item)An emitter, a stock emitter or a containerSoft

What each stop does:

SubjectDisableSoftDisable and AbsoluteDisable
The streamStops. Enabled and Loop are switched off.Stops. Enabled and Loop are switched off.
Particles in flightRemoved at once, including those in their Linger time.Left to finish their Lifetime and their Linger.
An Animate emitterSnaps back to the look it was built with, and hides.The cycle in progress plays to its end. The emitter then resets and hides.
Emitters inside item, nested ones includedHard stop.Soft stop.
Stock ParticleEmitters and Trails inside itemSwitched off. A timed start still waiting is cancelled.Enabled is set to false. Their particles fade as usual. A timed start still waiting is not cancelled.
Stock Beams inside itemSwitched off.Enabled is set to false.
A Delay still being waited out, on a play with a Duration above 0Cancelled.Cancelled.
A Delay still being waited out, on a play with a Duration of 0Not cancelled. The burst, or the one Animate cycle, still fires when the Delay ends.Not cancelled.

Disable and SoftDisable also switch off stock Highlights inside item. Disable leaves alone stock emitters that sit inside a RenderTemplate.

A stop call on an emitter also stops every play of that emitter made with EnableEmitAt or AbsoluteEmitAt. Disable removes the particles of those plays too. Their handles are not told. handle:Wait() on such a play still waits for its full Duration.

Disable and SoftDisable do nothing to a stock emitter passed by itself. AbsoluteDisable sets its Enabled to false.

A Disable called from an event script, before the script’s first wait, takes effect later in the same frame. It acts once every particle has been updated. SoftDisable acts at once. See The event script and its payload.

AfterWait with
Part_Icles:AbsoluteEmit(item)The number it gives back. See Waiting for the effect.
Part_Icles:AbsoluteEmitAt(...) or Part_Icles:EnableEmitAt(...)handle:Wait(). It returns early if the play is stopped. See The play handle.

An effect that never ends gives back nil in place of a number. Check for nil before waiting.

The timescale calls change how fast particles run: their motion, their graphs and their Lifetime.

CallitemWhat it does
Part_Icles:SetTimescale(item, scale, duration?, permanent?)One emitter or one stock ParticleEmitterSets the speed for that emitter’s particles.
Part_Icles:ClearTimescale(item)One emitter or one stock ParticleEmitterRemoves the speed set by the script. The emitter’s own Timescale applies again.
Part_Icles:AbsoluteSetTimescale(item, scale, duration?, permanent?)An emitter, a stock ParticleEmitter or a containerThe same, for the item and for every emitter and stock ParticleEmitter inside.
Part_Icles:AbsoluteClearTimescale(item)An emitter, a stock ParticleEmitter or a containerClears them all.
scaleResult
1Normal speed
0.5Half speed
2Double speed
0Frozen
Below 0The particles play backwards
Part_Icles:AbsoluteSetTimescale(effect, 0.25, 2)
Part_Icles:AbsoluteSetTimescale(effect, 0.25, nil, true)
Part_Icles:AbsoluteClearTimescale(effect)

The first line sets quarter speed for 2 seconds. The second sets quarter speed until the third line clears it.

SubjectRule
Which particlesThose in flight, and those made while the speed is in force.
The emitter’s Timescale graphReplaced while the speed is in force.
A timed speedEnds by itself after duration seconds of real time.
permanent set to trueduration is ignored.
Rate, Delay and DurationNot changed. The speed changes how particles run, not how they are made.
Emitters nested in a RenderTemplateNot affected by a call on the parent emitter. To slow a play with its nested particles, use handle:SetTimescale.
A stock ParticleEmitterIts TimeScale property is set. The old value is put back afterwards.
item is nil, or scale is not a numberNothing happens.

A speed set by a script is stored on the emitter. A permanent speed set from the command bar, in the editor, is saved with the place until it is cleared.

A permanent speed of 0 freezes particles in flight. A particle frozen part-way through its life never ends, and it keeps its place under the Particle Cap. Clear the speed, or call Part_Icles:Disable(item).

CallValuesWhat it does
Part_Icles:SetLink(item, target, mode?)item: one emitter. target: an instance, the text "camera", or nil for no link. mode: a Link Mode as text.Changes the emitter’s own Link settings, for every later firing. These are the settings of the Link section of the Properties panel.
Part_Icles:SetEmitParent(item, parent)item: one emitter. parent: an instance, or nil to go back to the starting place.Changes the emitter’s Emit Into.

mode is one of "Follow", "Pivot", "Weld", "WeldWithoutRotation" and "RigidLocal". Link describes each.

SetLink does nothing when item is nil or is not an emitter.

To link one play only, pass Link in the options of an EmitAt call.

Part_Icles.LinkService makes a Part, Model or Attachment follow another instance. No particles are involved.

CallGives backWhat it does
LinkService:Activate()NothingStarts the service. It may be called twice.
LinkService:Deactivate()NothingStops the service and ends every link. Linked parts get their Anchored state back.
LinkService:Link(part, target, mode?, duration?)NothingMakes part follow target on every frame. part keeps the offset it had at the moment of the call.
LinkService:Clear(part)NothingEnds the link of part. Its Anchored state is put back.
LinkService:IsLinked(part)true or falseSays whether part is linked.
Value of LinkAccepted
partA Part or MeshPart, a Model, or an Attachment
targetA Part or MeshPart, a Model, an Attachment, a Bone, or the camera
mode"Weld": position and rotation follow. It is used when mode is left out or is not known.
mode"Follow", "Pivot", "WeldWithoutRotation": position follows and the offset swings with the target. Rotation stays as it was. In this service the three are the same.
durationSeconds. Left out, the link lasts until it is cleared.
local LinkService = Part_Icles.LinkService
LinkService:Activate()
LinkService:Link(lantern, hand, "Weld")
SubjectRule
Anchoredpart is anchored while linked. For a Model, all its parts are. The old values come back on Clear, when the duration ends, or when either instance is removed.
An Attachment as partIt moves only if its parent is a Part or MeshPart.
A second Link on the same partIt replaces the first. The Anchored value put back later is the one from before the first link.
Link called before LinkService:Activate()The link is recorded and does nothing. Output shows one warning that begins [Part-Icles LinkService] Link called before Activate();.
Ignored without a messageA nil value. part and target being the same instance. A part of another class. Either instance without a parent.
CallWhat it does
Part_Icles:Preload(root, force?)Keeps textures loaded for root and everything under it. It covers every emitter, stock ParticleEmitter and stock Trail whose Preload Texture is on.
Part_Icles:Deload(root, force?)Releases what Preload(root) held. A texture stays loaded while anything else still holds it.
SubjectRule
force set to trueEverything under root is covered, whatever its Preload Texture reads.
ReturnPreload returns at once. Loading goes on in the background. One exception: in the first moments of a LocalScript it can wait up to 5 seconds for the player’s PlayerGui.
What is coveredDecals, Textures, ParticleEmitters, Beams, Trails, ImageLabels, SpecialMeshes, MeshPart textures and the maps of a SurfaceAppearance. That holds for each item covered and for everything under it.
Where it worksIn a LocalScript only. In a server Script both calls do nothing.
root is nilNothing happens.

Part_Icles:Activate() already does a Preload on a player’s machine. It covers emitters whose Preload Texture is on, and only those in place at that moment. It looks in Workspace, Lighting, ReplicatedStorage, StarterGui, StarterPack and ReplicatedFirst.

An effect added later is not picked up in a game. That holds for an effect made by a script and for one that arrives after Activate. Call Part_Icles:Preload(effect) on it.

Part_Icles:Deactivate() releases every texture.

Advanced lists which textures Preload Texture covers.

Part_Icles.MAX_ACTIVE_PARTICLES is a number. It starts at 1000.

Part_Icles.MAX_ACTIVE_PARTICLES = 3000
SubjectRule
In the gameThe cap is 1000 until a script sets it. ≡ ▸ Settings ▸ Particle Cap changes the cap in the editor only.
What countsParticles in flight, and particles still showing in their Linger time.
What does not countThe particles of a stock ParticleEmitter.
At the capNew particles are skipped until some end.
The valueThe module does not check it.

At the cap the Output window shows this line, at most once a second. N is the cap.

[Part-Icles] active particle cap (N) reached - new emits skipped (user Module code still runs).
MemberKindWhat it is
Part_Icles.Log.enabledtrue or false. Starts at true.Set to false, it silences the module’s Output messages and warnings. Errors are never silenced.
Part_Icles.Log.print(...), Part_Icles.Log.warn(...)CallsWrite to the Output window through the same switch. A script may use them for its own messages.
Part_Icles:GetFolder()Call. Gives back a Folder.The folder that holds the particles in flight. It is named EmittedPartsUsingPart_icle. It is made on first use, and it is not saved with the place. It sits under the camera of the machine the script runs on.
Part_Icles:GetPoolFolder()Call. Gives back a Folder.The folder that holds the idle particles of emitters with Pool on. It is named Part_IclesPooled and sits beside the first.
Part_Icles:GetData(item)Call. Gives back a table, or nil.The emitter’s settings, as the module reads them at each emit. nil for an instance that is not an emitter. The table is the module’s own. Read it only. Its field names can change between versions.
Part_Icles.ActiveEmitsA list. Read it only.#Part_Icles.ActiveEmits is the number of particles in flight. The plugin’s particle counter shows the same number.
Part_Icles.TransformCompletedA BindableEventIts Event runs with the new emitter after each successful Transform.
Part_Icles.parseDuration(value)Call. Gives back a number, or nil.Reads a Duration as the HUD ▸ Duration box does. A number comes back as it is. Text of two numbers, such as "1, 2", gives a random value between them. Text with no number gives nil.

Every particle carries the attribute _PartIcleEmit, set to true. A script that watches the Workspace can use it to tell a particle from the rest of the place.

The module has no call for the pool. Pooling is the emitter’s own Pool toggle, described on Advanced. An idle particle is discarded after 5 seconds without use. One emitter keeps at most about six times its Rate, plus 8. All emitters together keep at most 2048. Part_Icles:Deactivate() empties the pool. What mesh particles give and what they cost gives every rule.

Part_Icles:Transform(item) turns an instance into an emitter, as the Transform button does. It gives nothing back.

SubjectRule
Undo and selectionThe call makes no step in Studio’s undo history and does not change the selection.
An emitter, or a class the plugin cannot transformNothing happens.
The new emitterEmit count 1, Duration 0, Enabled off.
The types of the Transform as menuThe call does not choose them. Make these in the editor.

For AbsoluteEmit, a new emitter fires one particle. To change the size of the burst, set the emitter’s EmitCount attribute. The next section lists the attributes.

NameWhereKindMeaning
EmitCountThe emitter. Also a stock ParticleEmitter.NumberParticles in one burst. Missing counts as 1. 0 means no burst.
EmitDelayThe emitter. Also a stock ParticleEmitter, Trail or Beam.NumberSeconds before firing.
EmitDurationThe emitter. Also a stock ParticleEmitter, Trail or Beam.Number, or text "min,max"Seconds of stream after the burst.
EmissionModeThe emitterText: "Emit" or "Animate"The Mode.
AnimateLoopThe emittertrue or falseThe Loop of an Animate emitter. Enable and the stop calls write it.
EnabledThe emitter’s PartIclePropertiestrue or falseThe Enabled row. EnableEmit writes it during a Duration. AbsoluteEnable and the stop calls write it.
RateThe emitter’s PartIclePropertiesNumberRead on every frame while the emitter streams.
PreloadTextureThe emitter. Also a stock ParticleEmitter or Trail.true or falseThe Preload Texture toggle.
LinkMode, LinkSourceThe emitterTextSet them through SetLink, not by hand.
Link, EmitParentObjectValue children of the emitterInstanceSet them through SetLink and SetEmitParent.
TransformedThe emittertrue or falseHow the module knows an emitter.

Every other row of the Properties panel is an attribute on PartIcleProperties. The Property reference lists the names.

A value set by a script takes effect on the next particle made. Particles in flight keep what they had. See Edits and particles in flight.