@name BigAssSniper
@inputs Barrel:entity
@outputs BA:array T
@persist R:ranger [H Bul]:entity HS:vector
@autoupdate
interval(50)
E=entity()
if(first()){
    H=holoCreate(1)
    holoScale(1,vec(1.15,1.15,2.5))
    holoAlpha(1,100)
    HS=H:boxSize()
    T=1
}
if(dupefinished()){
    reset()
}
holoAng(1,E:angles())
holoPos(1,E:toWorld(vec(0,0,20)))
R=rangerOffsetHull(2.5,H:pos(),E:up(),HS)
if(R:entity():model()=="models/props_junk/watermelon01.mdl"){
    BA:pushEntity(R:entity())
    Bul=BA[1,entity]
    Bul:propFreeze(1)
    Bul:setPos(entity():toWorld(vec(0,0,35)))
    Bul:setAng(entity():angles())
    holoColor(1,vec(0,255,0))
}else{holoColor(1,vec(0,0,0))}
Trigger=owner():keyWalk()
if(changed(Trigger)&Trigger){
    Bul:setPos(entity():toWorld(vec(0,0,0)))
    Bul:propFreeze(0)
    BC=1
}
if(BC){
    Bul:applyForce(Bul:toWorld(vec(0,0,10000)*Bul:mass()*2000))
}
if(!Bul){
    BA:clear()
}
