################
# > Prop Tracer: Give any prop or entity an awesome trail.
# > How to use: Spawn it on a prop and move the prop for awesome effects.
################

@name Prop Tracer by Runeneo
@persist Prop:entity Count Size:vector Pos:vector Ang:angle Col Model:string

interval(10)

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

if (first() | duped()) {
    Prop = entity():isWeldedTo()
    Prop:setMaterial("models/debug/debugwhite")
    Model = Prop:model()
}

if (changed(Pos)|changed(Ang)) {
    
Col+=5
Colour=hsv2rgb(vec(Col%360,1,1))

holoCreate(Count)
holoPos(Count, Pos)
holoAng(Count, Ang)
holoColor(Count, Colour)
holoModel(Count, Model)
holoMaterial(Count, "models/debug/debugwhite")
Prop:setColor(Colour)

Count+=1

if (Count > 49) {
    Count = 0
}

}
