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

How do I change transparency using number sequence?

I need to use numbersequence to change the transparency of a part.

However I don't understand the wiki on how to use it.

I tried these but it didn't work.

for i=-0,1,0.1 do
	newpart.Trail.Transparency = NumberSequence.new({
		NumberSequenceKeypoint.new(0,1),
		NumberSequenceKeypoint.new(0,i)
	})
	wait(0.05)
end

or

for i=-0,1,0.1 do
	newpart.Trail.Transparency = NumberSequence.new(0,i)
	wait(0.05)
end

2 answers

✓ Accepted answer

You can use Tweening to change really any number/int value of your part. For you, insert this into the part:

local tweenService = game:GetService("TweenService")
local goal = {}
goal.Transparency = 1 --make sure part's transparency is 0 but goal's 1
local tween = TweenInfo.new(2) --speed of how fast
local playingTween = tweenService:Create(script.Parent, tween, goal)
playingTween:Play()

Or I saw you were using a trail: Just change script.Parent into script.Parent.Trail

The sequence types are mostly used as properties for trails, particles, etc. I think you just want to tween your transparency.

If not you might be able to use the Keypoints field of the sequence and use that.

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