Trail SWEP im clueless

I can make an SWEP just fine all I need to know is how would I go about making it so that the player that is shot has a trail applied to them

I found this
but dont quite understand it

Trace, hit an entity, check if it is a player, then apply the trail:
local pos = self.Owner:GetShootPos()
local ang = self.Owner:GetAimVector()
local tracedata = {}
tracedata.start = pos
tracedata.endpos = pos+(ang*80)
tracedata.filter = self.Owner
local trace = util.TraceLine(tracedata)
if trace.HitNonWorld and trace.Entity:IsPlayer() then
target = trace.Entity
local trail = util.SpriteTrail(target, 0, Color(255,0,0), false, 15, 1, 4, 1/(15+1)*0.5, “trails/plasma.vmt”)
Taken entirely from these 2 pages:


You sir, are the best :smiley: