Is there a way to make a tracer that remains for a moment or two?

Hello,

I am currently working on a laser sniper SWEP of some kind and one of the things I want to do with it is make the tracer for each shot linger in the air for a couple of seconds before fading away. Is such a thing possible to do?

Thanks for your time.

local StoreTracer
if CLIENT then
	local bullets = {}
	local fadeout_time = 0.5

	function StoreTracer( attacker, tr )
		if !IsValid( attacker ) or !attacker:IsPlayer( ) then return end

		local wep = attacker:GetActiveWeapon( )
		if !IsValid( wep ) then return end

		local muzzle = wep:GetAttachment( wep:LookupAttachment( "muzzle_flash" ) )
		if muzzle then
			tr.StartPos = muzzle.Pos
		end

	    tr.Time = CurTime( )
	    table.insert( bullets, tr )
	end

	hook.Add( "PostDrawTranslucentRenderables", "DrawBullet", function( )
		if table.IsEmpty( bullets ) then return end
	    local now = CurTime( )

	    render.SetColorMaterial( ) -- render.SetMaterial( **material here** )
	    for key, bullet in pairs( bullets ) do
	        if bullet.Time < now - fadeout_time then
	            bullets[ key ] = nil
	            continue
	        end
	        
	        local alpha = 255 - ((CurTime( ) - bullet.Time) * 255) / fadeout_time
	        render.DrawBeam( bullet.StartPos, bullet.HitPos, 1, 1, 1, Color( 255, 255, 255, alpha ) )
	    end
	end )
end

function SWEP:PrimaryAttack( )
	-- ... ... ...

	local bullet = {}
	bullet.Num = 1
	bullet.Src = self.Owner:GetShootPos()
	bullet.Dir = self.Owner:GetAimVector()
	bullet.Spread = Vector(0.01, 0.01, 0)
	bullet.Tracer = 1
	bullet.Force = 5
	bullet.Damage = 10

	if CLIENT then
		bullet.Callback = StoreTracer -- Main part
	end

	self.Owner:FireBullets(bullet)

	-- ... ... ...
end

Cheers mate.