@name e2 Turret 
@outputs Fire Reset
@persist Turret:entity Vec:vector Ang:angle E:entity Screen Bomb
@trigger 
runOnTick(1)

if(first()){
Turret = entity():isWeldedTo()
}



Vec = owner():pos() - Turret:pos() + vec(0,0,90)
Turret:applyForce((Vec + $Vec*5)*Turret:mass()*5)

O = owner()


P = Turret:elevation( O:aimPos() )
Y = Turret:bearing( O:aimPos() )
R = Turret:angles():roll()
Ang = -ang(P,Y,R)/15

Turret:applyAngForce((Ang + $Ang*30)*Turret:mass()*23)

if(O:keyAttack2()){ Fire = 1}
else {Fire = 0}


