@name Croco's E2 Door
@persist Array:array E:entity G
if(first()){
 E = propSpawn("models/props_c17/door01_left.mdl",entity():pos()+vec(0,0,55),1)
G = 0}
ANG = ang(0,90,0)
ANG2 = ang(0,0,0)
timer("check",130)
Distance = 50
if (clk("check")) {
    findInSphere(E:pos(), Distance)
    Array = findToArray()
    for(I=1,Array:count()) {
        if(Array[I,entity]:isPlayer()) {
            if(Array[I,entity]:isAlive()) {         
    P = findClosest(entity():pos())
    Use = P:keyUse()
    if(Use==1){G++}}}}}
if(G == 0){E:setAng(ANG2)}
if(G==1){E:setAng(ANG)}    
if(G==2){G = 0}
