@name Wave2
@outputs [Find]:array [Size ]:vector [MDL]:string CurIJ:vector2 BH CAMP
@persist Load Wave AMP CAMP Damp L Speed IndW BH
@persist [Hols HW]:array [HP]:vector
@persist [E O]:entity 
@persist SizeX SizeY S1 NEl PinSX PinSY AngH
#by Foton
if(first()){
    runOnTick(1) O=owner() E=entity()
    AMP=20 L=100 Damp=0.1 Speed=15 #<--------Wave Settings !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    E:setAlpha(0)
    findIncludePlayerProps(O)
    findByClass("prop_physics")
    Find=findToArray() 
    for(I=1,Find:count()){Find[I,entity]:propDelete()}
    Cur=holoCreate(0,E:pos(),vec(1,1,1.1),E:toWorld(ang(0,0,0)),vec(0,0,0))
    SizeArray=array("1x1","1x2","1x3","1x4","1x5","1x6","1x7","1x8",
                          "2x2","2x3","2x4","2x5","2x6","2x7","2x8",
                                "3x3","3x4","3x5","3x6","3x7","3x8",
                                      "4x4","4x5","4x6","4x7","4x8",
                                            "5x5","5x6","5x7","5x8",
                                                  "6x6","6x7","6x8",
                                                        "7x7","7x8",
                                                              "8x8")
    # 1-1x1, 9-2x2, 16-3x3, 22-4x4, 27-5x5, 31-6x6, 34-7x7, 36-8x8
    SizeNeed=16 ### <--------Change it [1; 36] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Str1="models/hunter/plates/plate" Str2=".mdl" MDL=Str1+SizeArray[SizeNeed,string]+Str2
    concmd("wire_expression2_model "+MDL)
    Size=E:boxSize() SizeX=Size:x()  SizeY=Size:y() S1=11.925
    PinSX=round(SizeX/S1) PinSY=round(SizeY/S1)
    NEl=PinSX*PinSY
    Wave=1
    Hols=array()
}
if(O:aimEntity()==E){
    Loc=E:toLocal(O:aimPos())
    CurIJ=vec2(ceil((Loc:x()+SizeX/2)/S1),ceil((Loc:y()+SizeY/2)/S1))
    }
holoPos(0,E:toWorld(vec((CurIJ:x()-PinSX/2-0.5)*S1,(CurIJ:y()-PinSY/2-0.5)*S1,0)))
if(Wave){
    if(Wave>1 & perf()){
        if(O:keyUse()){
            BH=CurIJ:x()+(CurIJ:y()-1)*PinSX
            CAMP=AMP
        }
        while(perf())
        {
        IndW++
        if(IndW%PinSX==0){CX=PinSX-1}else{CX=IndW%PinSX-1}
        if(IndW!=BH){H=CAMP*sin(180-Wave+360/L*(holoEntity(IndW):pos()-holoEntity(BH):pos()):length())}else{H=CAMP*sin(180+Wave)}
        HW[IndW,number]=H
        holoPos(IndW,E:toWorld(vec((CX-PinSX/2+0.5)*S1,(ceil(IndW/PinSX)-PinSY/2-0.5)*S1,H)))
        if(IndW==NEl){
            Wave+=Speed
            IndW=1
            if(CAMP>0){CAMP-=Damp}else{CAMP=0}
        }
        }
    }
    elseif(Wave==1 & holoCanCreate()){
        if(Hols:count()<NEl){
            Ind=Hols:count()+1
            if(Ind%PinSX==0){CX=PinSX-1}else{CX=Ind%PinSX-1}
            Hols[Ind,entity]=holoCreate(Ind,E:toWorld(vec((CX-PinSX/2+0.5)*S1,(ceil(Ind/PinSX)-PinSY/2-0.5)*S1,0)),vec(1,1,1),E:toWorld(ang(AngH,AngH,0)))
            holoColor(Ind, vec(50,50,255)) holoParent(Ind,E)
        }else{Wave=2} #/Load1
    }
}
if(Load){
    if(Load>1 & perf()){
        while(perf())
        {
        IndW++
        if(IndW%PinSX==0){CX=PinSX-1}else{CX=IndW%PinSX-1}
        holoColor(IndW,hsv2rgb(Load%360,1,1))
        holoPos(IndW,E:toWorld(vec((CX-PinSX/2+0.5)*S1,(ceil(IndW/PinSX)-PinSY/2-0.5)*S1,AMP*sin(360/PinSX*(CX+Load+ceil(IndW/PinSY))))))
        if(IndW==NEl){
            Load++
            IndW=1
        }
        }
    }
    elseif(Load==1 & holoCanCreate()){
        if(Hols:count()<NEl){
            Ind=Hols:count()+1
            if(Ind%PinSX==0){CX=PinSX-1}else{CX=Ind%PinSX-1}
            Hols[Ind,entity]=holoCreate(Ind,E:toWorld(vec((CX-PinSX/2+0.5)*S1,(ceil(Ind/PinSX)-PinSY/2-0.5)*S1,AMP*sin(320/PinSX*CX))),vec(1,1,1),E:toWorld(ang(AngH,AngH,0)))
            holoParent(Ind,E)
        }else{Load=2} #/Load1
    }
}
