Particle fade Transparency NumberSequence error

I am trying to make a script that fades out a particle smoothly but it gave me a NumberSequence error.


Here is the script I have right now:

				local newDeathParticle = particle.DeathParticle:Clone()
				newDeathParticle.Position = newMob.Torso.Position
				newDeathParticle.Parent = workspace.Particle
				newDeathParticle.Explosion:Emit(5)
				task.wait(0.4)
				while newDeathParticle.Explosion.Transparency > 1 do
					newDeathParticle.Explosion.Transparency += 0.05
					wait(0.1)
				end
1 Like

Particle Emitter’s transparency is a number sequence, which allows for points far away from the emitter to have a different transparency than particles close to the emitter.

For your case, something like this should worrk:

local Value = newDeathParticle.Explosion.Transparency.Keypoints[1].Value
while Value < 1 do -- you had > when it should be <
	newDeathParticle.Explosion.Transparency = NumberSequence.new(Value + 0.05)
	Value = newDeathParticle.Explosion.Transparency.Keypoints[1].Value
	wait(0.1)
end
1 Like

Screenshot 2025-01-26 233941

dang it, apparently I can’t use the ColorSequence shortcut.

Replace NumberSequence.new(Value + 0.05) with

NumberSequence.new({
	NumberSequenceKeypoint.new(0, Value + 0.05),
    NumberSequenceKeypoint.new(1, Value + 0.05)
})
1 Like
			local Value = newDeathParticle.Explosion.Transparency.Keypoints[1].Value
				while Value < 1 do
					newDeathParticle.Explosion.Transparency = ColorSequence.new({
						NumberSequenceKeypoint.new(0, Value + 0.05),
						NumberSequenceKeypoint.new(1, Value + 0.05)
					})
					Value = newDeathParticle.Explosion.Transparency.Keypoints[1].Value
					wait(0.1)
				end

I typoed it uggghh. It’s a number sequence, not a color sequence :frowning:

NumberSequence.new({
	NumberSequenceKeypoint.new(0, Value + 0.05),
    NumberSequenceKeypoint.new(1, Value + 0.05)
})
2 Likes

Thanks it works, I didnt really feel like talking that much today

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.