Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to change a ParticleEmitters lifetime via script?

I've tried to get this to work but the output is saying that I'm using a bad argument,

Here is my code,

local p = script.Parent
local pe = p.ParticleEmitter

pe.Lifetime = 5

It's probably a very simple fix, I've most likely just made a mistake, but I can't spot it out, thanks!

1 answer

Use the NumberRange.new() constructor, since ParticleEmitter.Lifetime is a NumberRange property.

Part = script.Parent
ParticleEmitter = Part.ParticleEmitter

ParticleEmitter.Lifetime = NumberRange.new(8, 10) -- This constructor accepts 1 or 2 arguments.

1 comment

0

Thats neat.

This discussion is preserved as it was. New answers, comments, and votes are closed.