
@outputs Forcer
@persist Gyro:angle
@persist Timer N

runOnTick(1)

Plate = entity()

Me = owner()

P = Plate:elevation(Me:aimPos())
Y = Plate:bearing(Me:aimPos())
R = Plate:angles():roll()
entity():setTrails(30,0,5,"trails/laser",vec(0,255,174),255) 


Gyro = -ang(P,Y,R)*10

Plate:applyAngForce(Gyro + $Gyro*5)

if(owner():keyUse())
    {
        Forcer == 1
    }
Plate:setColor(random(255),random(255),random(255),(50))
Plate:setMaterial("models/shiny")


interval(10)
Me=owner()
Chip=entity()
Timer=Timer+1*1
T=Timer

if(first()) {holoCreate(1)}

holoModel(1,"hqsphere")
holoMaterial(1,"models/shiny")
holoPos(1,Chip:pos()+vec(0,0,0))
holoColor(1,vec(148,226,99))
holoScale(1, vec(1,1,1))
holoAlpha(1,170)
holoParent(1,Chip)

timer("A",randint(2000,4000))
if(clk("A")) {N = 1} else {N = 0}
if(N&$N) {holoEntity(1):soundPlay(0,0,"weapons/bugbait/bugbait_squeeze"+randint(1,3)+".wav")}
if(!holoEntity(1):pos():isInWorld()) {V = vec(0,0,1)}


