@name DoorMostWanted
@inputs 
@outputs 
@persist A C State T1 T2 
@trigger 
interval(10)

E = entity():isWeldedTo()

if (first()) {
    holoCreate(1)
    holoPos(1,E:toWorld(vec(0,-35.5,0)))
    holoScale(1,vec(1.95,3.95,0.3))
    
    holoCreate(2)
    holoPos(2,E:toWorld(vec(0,-12.2,0)))
    holoScale(2,vec(1.95,3.95,0.3))
    
    holoCreate(3)
    holoPos(3,E:toWorld(vec(0,11.1,0)))
    holoScale(3,vec(1.95,3.95,0.3))
    
    holoCreate(4)
    holoPos(4,E:toWorld(vec(0,34.8,0)))
    holoScale(4,vec(2,3.95,0.3))
}

R = owner():keyWalk()

if(changed(R) & R) {if(State == 0) {State = 1} else {State = 0}}

if(State == 1) {
    if(A < 1170) {
        A += 5
        holoPos(1,holoEntity(1):pos() - vec(0,0.2,0))
    }
    timer("1",500)
}
if (clk("1")) { holoPos(2,holoEntity(2):pos() - vec(0,0.2,0)) }
