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

(ParticleEmitter) attempt to compare two userdata values ?

Hello everyone,

I'm having a problem...

I have written a small script which is supposed to change the size of the particle emitter by each (0.05) seconds or even faster, however, the particle is the particle of a fire, so it has a NumberSequence like this : NumberSequence.new(0.687, 0)

I'm trying to compare the NumberSequence to another NumberSequence just to make sure everything is fine...

Here is my script, any solution to remove the error?

-- Note : There are IntValues and etc, they don't matter and have nothing to do with the error :]


speed = 0.05
local sequence = NumberSequence.new(0.687, 0)
script.Parent.CanCharge:GetPropertyChangedSignal("Value"):Connect(function()
	wait()
			while true do
			if script.Parent.Properties.Fire.Size <= NumberSequence.new(2, 0) and script.Parent.CanCharge.Value == true then
				wait(speed)
				script.Parent.Properties.Fire.Size = script.Parent.Properties.Fire.Size + sequence
				
				speed = speed - 0.000085
			else
				break
			end
		end
end)

1 answer

I recommend that you're rather storing its current size in a variable rather than checking checking two NumberSequences. It's very difficult to calculate which size is the one with the highest value.

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