@name Spook
@inputs 
@outputs
@persist R Entity:entity RA:array T1 T2 T3
@persist I Model:string Pos:vector
@persist 
@trigger all
if(first()){
holoCreate(1)
holoCreate(2)
holoCreate(3)
holoCreate(4)
holoCreate(5)
holoCreate(6)
holoCreate(7)
holoCreate(8)
holoCreate(9)
RA:setString(1,"models/Combine_Helicopter/helicopter_bomb01.mdl")#model
RA:setString(2,"models/Combine_Helicopter/helicopter_bomb01.mdl")
RA:setString(3,"models/Combine_Helicopter/helicopter_bomb01.mdl")
    holoCustomModel(1,RA:string(1),1)
    holoCustomModel(2,RA:string(2),1)
    holoCustomModel(3,RA:string(3),1)
    holoCustomModel(4,RA:string(1),1)
    holoCustomModel(5,RA:string(2),1)
    holoCustomModel(6,RA:string(3),1)
    holoCustomModel(7,RA:string(1),1)
    holoCustomModel(8,RA:string(2),1)
    holoCustomModel(9,RA:string(3),1)
RA:setEntity(4,entity():owner())#target
RA:setEntity(5,entity():owner())
RA:setEntity(6,entity():owner())
RA:setNumber(7,1)#interval
RA:setNumber(8,1)
RA:setNumber(9,1)
RA:setNumber(10,200)#Radius
RA:setNumber(11,200)
RA:setNumber(12,200)
RA:setVector(13,vec(0,0,30))#offset
RA:setVector(14,vec(0,0,30))
RA:setVector(15,vec(0,0,30))

}
interval(10)
    holoPos(1,RA:entity(4):pos() + vec(sin(T1)*RA:number(10),cos(T1)*RA:number(10),0) +RA:vector(13))
    holoPos(2,RA:entity(5):pos() + vec(sin(T2+40)*RA:number(11),cos(T2+40)*RA:number(11),0)+RA:vector(14))
    holoPos(3,RA:entity(6):pos() + vec(sin(T3+80)*RA:number(12),cos(T3+80)*RA:number(12),0)+RA:vector(15))
    holoPos(4,RA:entity(4):pos() + vec(sin(T1+120)*RA:number(10),cos(T1+120)*RA:number(10),0)+RA:vector(13))
    holoPos(5,RA:entity(5):pos() + vec(sin(T2+160)*RA:number(11),cos(T2+160)*RA:number(11),0)+RA:vector(14))
    holoPos(6,RA:entity(6):pos() + vec(sin(T3+200)*RA:number(12),cos(T3+200)*RA:number(12),0)+RA:vector(15))
    holoPos(7,RA:entity(4):pos() + vec(sin(T1+240)*RA:number(10),cos(T1+240)*RA:number(10),0)+RA:vector(13))
    holoPos(8,RA:entity(5):pos() + vec(sin(T2+280)*RA:number(11),cos(T2+280)*RA:number(11),0)+RA:vector(14))
    holoPos(9,RA:entity(6):pos() + vec(sin(T3+320)*RA:number(12),cos(T3+320)*RA:number(12),0)+RA:vector(15))

    holoAng(1,ang(0,-T1-90,0))
    holoAng(2,ang(0,-T2-40-90,0))
    holoAng(3,ang(0,-T3-80-90,0))
    holoAng(4,ang(0,-T1-120-90,0))
    holoAng(5,ang(0,-T2-160-90,0))
    holoAng(6,ang(0,-T3-200-90,0))
    holoAng(7,ang(0,-T1-240-90,0))
    holoAng(8,ang(0,-T2-280-90,0))
    holoAng(9,ang(0,-T3-320-90,0))

    holoCustomModel(1,RA:string(1),1)
    holoCustomModel(2,RA:string(2),1)
    holoCustomModel(3,RA:string(3),1)
    holoCustomModel(4,RA:string(1),1)
    holoCustomModel(5,RA:string(2),1)
    holoCustomModel(6,RA:string(3),1)
    holoCustomModel(7,RA:string(1),1)
    holoCustomModel(8,RA:string(2),1)
    holoCustomModel(9,RA:string(3),1)
    
    T1 += RA:number(7)
    T2 += RA:number(8)
    T3 += RA:number(9)
    
if(entity():owner():lastSaid() == "Ent" & curtime() - entity():owner():lastSaidWhen() <= 0.2) {
    Entity = entity():owner():aimEntity()
    RA:setEntity(4,Entity)
    RA:setEntity(5,Entity)
    RA:setEntity(6,Entity)
}
if(entity():owner():lastSaid() == "Me") {
    Entity = entity():owner()
    RA:setEntity(4,Entity)
    RA:setEntity(5,Entity)
    RA:setEntity(6,Entity)
}


if(entity():owner():lastSaid():explode("|"):string(1) == "I"  & curtime() - entity():owner():lastSaidWhen() <= 0.2){
    I = entity():owner():lastSaid():explode("|"):string(2):toNumber()
    RA:setNumber(7,I)
    RA:setNumber(8,I)
    RA:setNumber(9,I)
    T = 0
    T1 = T
    T2 = T
    T3 = T
}
if(entity():owner():lastSaid():explode("|"):string(1) == "Pos"  & curtime() - entity():owner():lastSaidWhen() <= 0.2){
    Pos = vec(entity():owner():lastSaid():explode("|"):string(2):toNumber(),
entity():owner():lastSaid():explode("|"):string(3):toNumber(),
entity():owner():lastSaid():explode("|"):string(4):toNumber())
    RA:setVector(13,Pos)
    RA:setVector(14,Pos)
    RA:setVector(15,Pos)
}
if(entity():owner():lastSaid():explode("|"):string(1) == "R"  & curtime() - entity():owner():lastSaidWhen() <= 0.2){
    R = entity():owner():lastSaid():explode("|"):string(2):toNumber()
    RA:setNumber(10,R)
    RA:setNumber(11,R)
    RA:setNumber(12,R)
}
if(entity():owner():lastSaid():explode("|"):string(1) == "Model"  & curtime() - entity():owner():lastSaidWhen() <= 0.2){
    Model = entity():owner():lastSaid():explode("|"):string(2)
    RA:setString(1,Model)
    RA:setString(2,Model)
    RA:setString(3,Model)
}

if(entity():owner():lastSaid():explode("|"):string(1) == "Pos1"  & curtime() - entity():owner():lastSaidWhen() <= 0.2){
    RA:setVector(13,vec(entity():owner():lastSaid():explode("|"):string(2):toNumber(),
entity():owner():lastSaid():explode("|"):string(3):toNumber(),
entity():owner():lastSaid():explode("|"):string(4):toNumber()))
}

if(entity():owner():lastSaid():explode("|"):string(1) == "Pos2"  & curtime() - entity():owner():lastSaidWhen() <= 0.2){
    RA:setVector(14,vec(entity():owner():lastSaid():explode("|"):string(2):toNumber(),
entity():owner():lastSaid():explode("|"):string(3):toNumber(),
entity():owner():lastSaid():explode("|"):string(4):toNumber()))
}

if(entity():owner():lastSaid():explode("|"):string(1) == "Pos3"  & curtime() - entity():owner():lastSaidWhen() <= 0.2){
    RA:setVector(15,vec(entity():owner():lastSaid():explode("|"):string(2):toNumber(),
entity():owner():lastSaid():explode("|"):string(3):toNumber(),
entity():owner():lastSaid():explode("|"):string(4):toNumber()))
}



if(entity():owner():lastSaid():explode("|"):string(1) == "I1"  & curtime() - entity():owner():lastSaidWhen() <= 0.2){
    RA:setNumber(7,entity():owner():lastSaid():explode("|"):string(2):toNumber()
)
}
if(entity():owner():lastSaid():explode("|"):string(1) == "I2"  & curtime() - entity():owner():lastSaidWhen() <= 0.2){
    RA:setNumber(8,entity():owner():lastSaid():explode("|"):string(2):toNumber()
)
    }
if(entity():owner():lastSaid():explode("|"):string(1) == "I3"  & curtime() - entity():owner():lastSaidWhen() <= 0.2){
    RA:setNumber(9,entity():owner():lastSaid():explode("|"):string(2):toNumber()
)
}



if(entity():owner():lastSaid():explode("|"):string(1) == "R1"  & curtime() - entity():owner():lastSaidWhen() <= 0.2){
    RA:setNumber(10,entity():owner():lastSaid():explode("|"):string(2):toNumber()
)
}
if(entity():owner():lastSaid():explode("|"):string(1) == "R2"  & curtime() - entity():owner():lastSaidWhen() <= 0.2){
    RA:setNumber(11,entity():owner():lastSaid():explode("|"):string(2):toNumber()
)
}
if(entity():owner():lastSaid():explode("|"):string(1) == "R3"  & curtime() - entity():owner():lastSaidWhen() <= 0.2){
    RA:setNumber(12,entity():owner():lastSaid():explode("|"):string(2):toNumber()
)
}




if(entity():owner():lastSaid():explode("|"):string(1) == "M1"  & curtime() - entity():owner():lastSaidWhen() <= 0.2){
    RA:setString(1,entity():owner():lastSaid():explode("|"):string(2))
}
if(entity():owner():lastSaid():explode("|"):string(1) == "M2"  & curtime() - entity():owner():lastSaidWhen() <= 0.2){
    RA:setString(2,entity():owner():lastSaid():explode("|"):string(2))
}
if(entity():owner():lastSaid():explode("|"):string(1) == "M3"  & curtime() - entity():owner():lastSaidWhen() <= 0.2){
    RA:setString(3,entity():owner():lastSaid():explode("|"):string(2))
}




if(entity():owner():lastSaid() == "Me1") {
    RA:setEntity(4,entity():owner())
}
if(entity():owner():lastSaid() == "Me2") {
    RA:setEntity(5,entity():owner())
}
if(entity():owner():lastSaid() == "Me3") {
    RA:setEntity(6,entity():owner())
}





if(entity():owner():lastSaid() == "RA:entity(4)" & curtime() - entity():owner():lastSaidWhen() <= 0.2) {
    RA:setEntity(4,entity():owner():aimEntity())
}
if(entity():owner():lastSaid() == "RA:entity(5)" & curtime() - entity():owner():lastSaidWhen() <= 0.2) {
    RA:setEntity(5,entity():owner():aimEntity())
}
if(entity():owner():lastSaid() == "RA:entity(6)" & curtime() - entity():owner():lastSaidWhen() <= 0.2) {
    RA:setEntity(6,entity():owner():aimEntity())
}
