@name Sticky launcher
@inputs 
@outputs 
@persist N New Old Dir:array Grav:array
@trigger 

interval(10)
New = owner():keyAttack2()
if(New == 1 & Old != New & N < 8)
{
    N++
    holoCreate(N)
    holoModel(N,"models/weapons/w_models/w_stickybomb.mdl")
    holoPos(N,owner():shootPos())
    Dir[N,vector] = owner():eye()
}


for(I = 0,N)
{
    if(holoEntity(I):pos():isInWorld())
    {
        if((holoEntity(I):pos() - vec(0,0,Grav[I,number])):isInWorld())
        {
            holoPos(I,holoEntity(I):pos() + (Dir[I,vector] * 5) - vec(0,0,Grav[I,number]))
        }
    }
    Grav[I,number] = Grav[I,number] + 0.1
    
    for(D = 0,numPlayers())
    {
        if((holoEntity(I):pos()):distance(findPlayerByName("Mega"):pos()) < 100)
        {
            holoDelete(I)
        } 
    }
}

Old = New
