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

Low down the speed little by little?

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?

1 comment

0

Why do you have that NumberRange.new(1,1) you could just have 1?

1 answer

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

2 comments

0

Be sure to format your code. It makes everyone's life easier. https://dptole.github.io/lua-beautifier/

0

Ok! Thank you

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