@name Ultimate E2 - Croco
@persist Array:array T:string X3 Y3 Z3 E:entity Array2:array H:entity T2:string
@persist V:vector Target3:array
@persist Chip:entity Plate:entity Me:entity  Array4:array NAME:string 
@outputs A
runOnTick(1)
runOnChat(1)
if(first()){A = 1
    holoCreate(1337)
    holoAlpha(1337,0)
    }

if (chatClk(owner())) {
    Array = owner():lastSaid():lower():explode(" ")   
        if(Array[1,string]==">rocket"){
            Target=Array[2,string]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     setName("Rocketing e2 (Idea by Mr. Croc)")                                                                                                                                                                                                                                                                                                 
            E=findPlayerByName(Target)
            if(E:isPlayer()){
            E:applyPlayerForce(E:up()*99999)
            T = E:name()  
            timer("rocket",700)
            timer("explode",2000)
            holoCreate(1)
            holoParent(1,E)
            holoPos(1,E:pos())
            holoAlpha(1,0) holoEntity(5):setTrails(121,100,100,"trails/smoke",vec(200,200,255),255,222,222)

    }}
    }
    
if(clk("rocket")){                concmd("say /me rocketed " + T +"!")}
if(clk("explode")){

    Prop=propSpawn("models/props_phx/cannonball.mdl",1)
    Prop:setPos(holoEntity(1):pos())
    Prop:propBreak()
}
            if (chatClk(owner())) {
    Array2 = owner():lastSaid():lower():explode(" ")   
        if(Array2[1,string]==">bring"){
            Target2=Array2[2,string]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     setName("Rocketing e2 (Idea by Mr. Croc)")                                                                                                                                                                 
            H=findPlayerByName(Target2)
            
            timer("A1",7000)
            timer("A2",8500)

}}
if(clk("A1")){A==0
    T2 = H:name() 
            concmd("say /me has brought"+ " " + T2 +" to them!")}
if(clk("A2")){A==1 H = owner()}
  X =   owner():pos():x()
  Y =   owner():pos():y()
  Z =   owner():pos():z()
  X2 =   H:pos():x()
  Y2 =   H:pos():y()
  Z2 =   H:pos():z()
 

    X3 = X2 - X
    Y3 = Y2 - Y
    Z3 = Z2 - Z
if(H:isPlayer()){
    if(A == 1){
H:applyPlayerForce(vec(-X3,-Y3,-Z3))

}}


            if (chatClk(owner())) {
    Array4 = owner():lastSaid():lower():explode(" ")   
        if(Array4[1,string]==">bubble"){


 Chip=owner()
 holoCreate(1000)
  holoModel(1000,"hqicosphere2")
    holoColor(1,vec(255,255,255))
    holoScale(1000,vec(75,75,75))
    holoColor(1000,vec(255,255,255))
    holoMaterial(1000,"models/props_lab/warp_sheet")
    holoCreate(1001)
    holoScale(1001,vec(-75,-75,-75))
   holoModel(1001,"hqicosphere2")
    holoColor(1,vec(255,255,255))
    holoColor(1001,vec(255,255,255))
    holoMaterial(1001,"models/props_combine/portalball001_sheet")
    holoPos(1000,owner():pos())
        holoPos(1001,owner():pos())
    holoParent(1000,Chip)
    holoParent(1001,Chip)}
        if(Array2[1,string]==">drop"){holoPos(1337,owner():pos())
            holoParent(1000,holoEntity(1337))
            holoParent(1001,holoEntity(1337))
            Chip = holoEntity(1337)}
            
                    if(Array4[1,string]==">grab"){holoPos(1337,owner():pos())
                        Chip = owner()
                holoPos(1000,owner():pos())
        holoPos(1001,owner():pos())
             holoParent(1000,Chip)
            holoParent(1001,Chip)
            }
                    if(Array4[1,string]==">add"){
        NAME=Array4[2,string]     }
                            if(Array4[1,string]==">add2"){
        NAME2=Array4[2,string]     }
                            if(Array4[1,string]==">add3"){
   NAME3=Array4[2,string]     }
                                
         



        
        
        
        
        
        
        
}

runOnChat(1)
findExcludePlayer(owner())
findExcludePlayer("croco")
findExcludePlayer("brony")
findExcludePlayer(NAME)  
findExcludePlayer(NAME2) 
findExcludePlayer(NAME3) 
findByClass("player")
Target3 = findToArray()
for(I=1,Target3:count()){
    if(ops() > 4000){break}    
    if(Target3[I,entity] != owner() & Target3[I,entity]:pos():distance(Chip:pos()) < 475 & Target3[I,entity]:isAlive()){
        TT = Target3[I,entity]:pos()  
        holoCreate(I)
        holoModel(I,"hqicosphere2")
        holoScale(I,vec(-5,-5,-5))
        holoColor(I,vec(0,0,0))
        holoPos(I,TT + vec(0,0,50))
HH = propSpawn("models/props_phx/ball.mdl",TT,1)
HH:propBreak()

 
            if(Target3[I,entity]:pos():distance(Chip:pos()) > 360){
            holoDelete(I)
                 Plate:propFreeze(1)  
                
            }else{
                continue
                holoDelete(I)
        Plate:propFreeze(0)  }}
            }


