@name E2door
@outputs Door 
@persist Allow:array Dis:array 
runOnChat(1)
interval(500)

A = owner():lastSaid():explode(" ")

findInSphere(entity():pos(),500)
User = find()

if (changed(User:aimEntity() == entity()) & User:aimEntity() == entity()) {
    hideChat(1)
    
    Allow:pushEntity(User)
}

if (A[1,string] == ".remove" & chatClk(owner())) {
    hideChat(1)
    
    B = findPlayerByName(A[2,string])
    for (I = 1,Allow:count()) {
        if (B == Allow[I,entity]) {
            Allow:remove(I)
        }
    }
}

if (chatClk(owner()) & owner():lastSaid():lower():find("!list")) {
    hideChat(1)
    print(Allow)
}

for (I = 1,Allow:count()) {
    Dis[I,number] = round((entity():pos() - Allow[I,entity]:pos()):length())
}

if (Dis[1,number] <= 35 & Dis[1,number] != 0) {Door = 1}
elseif (Dis[2,number] <= 35 & Dis[2,number] != 0) {Door = 1}
elseif (Dis[3,number] <= 35 & Dis[3,number] != 0) {Door = 1}
elseif (Dis[4,number] <= 35 & Dis[4,number] != 0) {Door = 1}
elseif (Dis[5,number] <= 35 & Dis[5,number] != 0) {Door = 1}
else {Door = 0}
