################
# > Motion Blur: Create a motion blur effect on any prop or entity.
# > How to use: Spawn it on a prop and move the prop to motion blur it.
################

@name Motionblur
@persist Prop:entity Count Size:vector Pos:vector Ang:angle Model:string
@persist Alpha:array AlphaCount HoloNum

interval(10)

Pos = Prop:pos()
Ang = Prop:angles()
HoloNum = 20

if (first() | duped()) {
    Prop = entity():isWeldedTo()
    Model = Prop:model()
}

if (changed(Pos)|changed(Ang)) {

holoCreate(Count)
holoPos(Count, Pos)
holoAng(Count, Ang)
holoModel(Count, Model)
for (AlphaCount=0, HoloNum) {
    Alpha[AlphaCount,number]=(Alpha[AlphaCount,number]-255/HoloNum)
    Alpha[Count,number]=255
    holoAlpha(AlphaCount,Alpha[AlphaCount,number])
}

Count+=1

if (Count > HoloNum) {
    Count = 0
}

}
