
@name Holo Build area
@persist Total E:array Scale Scale2 Target:entity Mat:string

runOnTick(1)

Target=owner()

Color=vec(255,182,0)
Scale=300
findExcludePlayer(owner())
findExcludePlayerProps(owner())
findExcludePlayer(Target)

findExcludePlayerProps(Target)
Total=findInSphere(Target:pos(),Scale*7)
E=findToArray()

if(first()){
    Mat=""
    
    entity():propNotSolid(1)
    Scale2=-Scale*10

    entity():propNotSolid(1)
    entity():setAlpha(255)


    holoCreate(1,Target:pos())
    holoCreate(2,Target:pos())
    holoCreate(3,Target:pos())
    holoCreate(4)
    holoModel(1,"hq_sphere")
    holoModel(2,"hq_sphere")
    holoModel(3,"hq_sphere")
    holoColor(1,Color)
    holoColor(2,Color)
    holoColor(3,Color)
    holoMaterial(1,Mat)
    holoMaterial(2,Mat)
    holoMaterial(3,Mat)
    holoAlpha(1,30)
    holoAlpha(2,255)
    holoAlpha(3,255)
    holoAlpha(4,0)
    holoScaleUnits(1,vec(Scale2,Scale2,Scale2))
    holoScaleUnits(2,vec(-Scale2,-Scale2,-Scale2))
    holoScaleUnits(3,vec(Scale*7,Scale*7,Scale*7))
    holoParent(1,Target)
    holoParent(2,Target)
    holoParent(3,Target)
    
    holoVisible(2,owner(),0)
    holoVisible(3,owner(),0)
    holoVisible(2,Target,0)
    holoVisible(3,Target,0)
}
elseif(changed(owner():pos())&owner():pos():distance(Target:pos())>Scale*7){
    holoVisible(2,owner(),1)
    holoVisible(3,owner(),1)
    holoVisible(2,Target,0)
    holoVisible(3,Target,0)
}
elseif(changed(owner():pos())&owner():pos():distance(Target:pos())<Scale*7){
    holoVisible(2,owner(),0)
    holoVisible(3,owner(),0)
    holoVisible(2,Target,0)
    holoVisible(3,Target,0)
}
    
for(I=1,Total){
    holoPos(4,Target:pos())
    holoAng(4,(holoEntity(4):pos() - E[I,entity]:pos()):toAngle())
    if(!E[I,entity]:isAdmin()&!E[I,entity]:isSuperAdmin()){
        if(E[I,entity]:pos():distance(Target:pos())<Scale*10){
            if(E[I,entity]:inNoclip()){
              #  concmd("say @noclip "+E[I,entity]:steamID()+" 0")
            }
            E[I,entity]:applyPlayerForce(holoEntity(4):forward()*-9999)
        }
        elseif(E[I,entity]:pos():distance(Target:pos())<Scale*7){
        #    concmd("say @slap "+E[I,entity]:steamID()+" 1.24e+999")
        }
            
    }
}
