@name Prop Door
@inputs [E1 E2 E3 E4 E5 E6 E7]:entity
@persist [R]:array O V
interval(100)
if(first())
{
    runOnTick(1)
    runOnChat(1)
    R = array("STEAM_0:0:56021974")
}
if(chatClk())
{
    for(I=1,R:count())
    {
        if(lastSpoke():steamID()==R[I,string])
        {
            V = 1
            break
        }else
        {
            V = 0
        }

    }
    if(V)
    {
        LS = lastSaid():lower()
        if(LS=="/o")
        {
            O = 1
            soundPlay("open",1.5,"buttons/button_synth_positive_01.wav")
        }
        if(LS=="/c")
        {
            O = 0
            soundPlay("open",1.5,"buttons/button_synth_negative_02.wav")
        }
    }
}
if(changed(O))
{
    E1:propNotSolid(O)
    E2:propNotSolid(O)
    E3:propNotSolid(O)
    E4:propNotSolid(O)
    E5:propNotSolid(O)
    E6:propNotSolid(O)
    E7:propNotSolid(!O)
    E1:setColor(vec(255),255-(O*200))
    E2:setColor(vec(255),255-(O*200))
    E3:setColor(vec(255),255-(O*200))
    E4:setColor(vec(255),255-(O*200))
    E5:setColor(vec(255),255-(O*200))
    E6:setColor(vec(255),255-(O*200))
    E7:setColor(vec(255),255-(!O*200))
}
if(duped()||dupefinished())
{
    reset()
}
