Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local slots = {
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0}
- local combination = {
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8}
- for i=1,9 do
- peripheral.call("back","setSlot",i,{id = "minecraft:stained_glass_pane", dmg = slots[i]})
- end
- local points = 0
- while true do
- local event, slot, side = os.pullEvent("slot_click")
- if slots[slot] < 15 then
- slots[slot] = slots[slot] + 1
- else
- slots[slot] = 0
- end
- peripheral.call("back","setSlot",slot,{id = "minecraft:stained_glass_pane", dmg = slots[slot]})
- points = 0
- for i=1,9 do
- if slots[i] == combination[i] then
- points = points + 1
- end
- end
- if points == 9 then
- commands.exec("give @p minecraft:diamond")
- for i=1,9 do
- local rnd = math.random(0,15)
- combination[i] = rnd
- print(i,":",rnd)
- for i=1,9 do
- slots[i] = 0
- peripheral.call("back","setSlot",i,{id = "minecraft:stained_glass_pane", dmg = slots[i]})
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment