Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to add to the value of a NumberRange?

Asked by 5 years ago
Edited by User#24403 5 years ago

So, I'm struggling with this single line of code, all i want to do is add to the value of it. Its quite important that i do this as its tied in with a throttle control of a vehicle im working on. More throttle will equal more lifetime and speed of the emitter. Now, I haven't used .new because that wouldn't work in my system from what i know(which isn't much with emitters) as each function will be repeated adding more power and speed to the vehicle the more the throttle is pressed so, any ideas in what i could do with this?

local emitter = smokeemit.ParticleEmitter
emitter.Lifetime.NumberRange = emitter.Lifetime.NumberRange+.05,.05

Any help is much appropriated!


Edit; i put particle emitter in a variable because the line was cutting off so I made it shorter.
0
Post an error if any. User#24403 69 — 5y
0
'NumberRange' is not a valid member of NumberRange - thats what im getting, Iknow its wrong. The rest of the system works by adding to the values every time E is presses, so lets say the vehicle seat has no torque. Each time i press E it will add, 1 to the torque and keep doing that on every press until a numbervalue = 20. I kinda need the emmiters to do the same otherwise it wont work in my syst. XxHURSTY 0 — 5y
0
emitter.Lifetime = NumberRange.new(emitter.Lifetime.Min+.05,emitter.Lifetime.Max+.05) strongrussianboy123 68 — 5y
0
Yep, solved my problem. Cheers mate! XxHURSTY 0 — 5y

Answer this question