-- this part makes the brick draw:

lastpoint = Vector3.new(0, 0, 0)
leds = {}
function makeled()
	tip = script.Parent:FindFirstChild("Tip")
	if tip~= nil then
		off = (tip.Mesh.Scale.z/tip.Size.z)/2
		point = (tip.CFrame*CFrame.new(0, 0, -off)).p
		unit = (lastpoint - point).unit
		mag = (lastpoint - point).magnitude
		if mag>1 then
			middle = lastpoint-(unit*(mag/2))
			cf = CFrame.new(middle, point)
			local l = Instance.new("Part")
			l.Name = "Led"
			l.Anchored = true
			l.CanCollide = false
			l.Size = Vector3.new(1, 1, 1)
			l.BrickColor = tip.BrickColor
			l.TopSurface = 0
			l.BottomSurface = 0
			local m=  Instance.new("SpecialMesh")
			m.MeshType = "Brick"
			m.Scale = Vector3.new(.3, .3, mag)/l.Size
			m.Parent = l
			l.Parent = workspace
			l.CFrame = cf
			table.insert(leds, l)
			lastpoint = point
		end
	end
end
function fade()
	for i, v in pairs(leds) do
		if v~= nil then
			v.Transparency = v.Transparency+.04
			if v.Transparency>1 then
				v:remove()
			end
		end
	end
end

while true do
	makeled()
	wait(.004)
	fade()
end






