// make the trail function MakeTrails( entity, col ) local trail = ents.Create( "env_spritetrail" ) trail:SetPos( entity:GetPos() ) trail:SetParent( entity ) trail:SetKeyValue( "targetname", "" ) trail:SetKeyValue( "parentname", "" ) trail:SetKeyValue( "lifetime" , "2.5" ) trail:SetKeyValue( "startwidth", "3" ) trail:SetKeyValue( "endwidth" , "1" ) trail:SetKeyValue( "spritename", "sprites/laserbeam.vmt" ) trail:SetKeyValue( "renderamt", "255" ) trail:SetKeyValue( "rendermode", "5" ) trail:SetKeyValue( "rendercolor", col ) trail:Spawn() end // useage function ENT:Initialize() MakeTrails( self.Entity, "50 100 255" )