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

Low down the speed little by little?

Asked by 5 years ago
Edited 5 years ago

Hi! I'm trying to low down the speed of a ParticleEmitter little by little with this script

while true do
    script.Parent.Speed = script.Parent.Speed - NumberRange.new(1,1)
    wait(0.1)
end

On the output it says: " Workspace.Top gun.Nozzle.ParticleEmitter.Script:2: attempt to perform arithmetic on field 'Speed' (a userdata value)" Any solution?

0
Why do you have that NumberRange.new(1,1) you could just have 1? firestarroblox123 440 — 5y

1 answer

Log in to vote
0
Answered by
3132750 45
5 years ago

I've never really used particle emitters before, but this code works.

local Val = 50
script.Parent.Speed = NumberRange.new(Val)
while true do
    Val = Val-1
script.Parent.Speed = NumberRange.new(Val)
wait(0.1)
end
0
Be sure to format your code. It makes everyone's life easier. https://dptole.github.io/lua-beautifier/ ScuffedAI 435 — 5y
0
Ok! Thank you Robloximario952 18 — 5y
Ad

Answer this question