@name CountdownButton
@inputs User:entity
@persist Timer:table
@outputs A Text:string Color:vector

if(~User & User) {
    local Steam=User:steamID()
    if(Timer[Steam,number]<curtime()) {
        Timer[Steam,number]=curtime()+60
        Color=vec(0,255,0)
        A=1
        Text="Button unlocked for 3 seconds."
        stoptimer("stop")
        timer("stop",3000)
    } else {
        Color=vec(255,0,0)
        Text="You must wait "+ceil(Timer[Steam,number]-curtime())+" more seconds."
    }
}

if(clk("stop")) {A=0}
