@name Prop Launcher
@persist P:array
if(first())
{
    runOnTick(1)
}

if(changed(owner():keyUse())&owner():keyUse())
{
    local TE = propSpawn("models/props_junk/watermelon01.mdl",owner():shootPos()+owner():eye()*150,owner():eyeAngles(),0)
    
    TE:setTrails(100,0,1,"trails/lol",vec(randint(0,1)*255,randint(0,1)*255,randint(0,1)*255),255)
    
    TE:applyForce(owner():eye()*10000*TE:mass())
    
    TE:soundPlay(TE:id(),0,"vuvuzela_loop_close.wav")
    soundPitch(TE:id(),random(50,255))
    
    P:pushEntity(TE)
}

#[
if(P:count()>0)
{
    foreach(I, E:entity = P)
    {
        if(E:vel():length()<2000)
        {
            E:propDelete()
            P:remove(I)
        }
    }
}
]#
