@name Police E2 Door
@outputs A
@persist Open Target:entity
interval(100)
findByClass("player")
Cop=findClosest(entity():isWeldedTo():pos())
if (Cop:aimEntity()==entity():isWeldedTo() & Cop:isAuthorisedPersonnel() & Cop:keyUse()) {
    A=1
    Open=1
    Target=Cop
} elseif (!Open) {A=0}
if (!Target:keyUse()) {Open=0}
