@name sShopKeeper Vending Core
@inputs User:wirelink
@persist Target:entity

Global=gTable("sKeeper2")
if (first() | dupefinished()) {
    timer("Go",1500)
}

if (clk("Go")) {
    Target=Global["Vend",array][1,entity]
    if (!Target) {Target=entity()}
    Global["Vend",array]:removeEntity(1)
    User:entity():setPos(Target:toWorld(Target:aabbSize()*vec(0,0,0.5)))
    timer("Vend",10)
}

if (clk("Vend")) {
    User["Fire",number]=1
    timer("nv",1)
}

if (clk("nv")) {
    User["Fire",number]=0
    timer("Go",1500)
}
