Advertisement
Marlingaming

Shop Currency 2

Oct 28th, 2022 (edited)
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. local Items = {"minecraft:coal_ore","minecraft:iron_ore","minecraft:gold_ore","minecraft:redstone"}
  2. local Payment = {"currency:hundred_dollar_bill"}
  3. local Amount = {64,16,2,32}
  4.  
  5. local function start()
  6. Menu()
  7. Options()
  8. os.reboot()
  9. end
  10.  
  11. local function Buy(ID)
  12. if commands.exec("clear @p currency:hundred_dollar_bill 1") == true then commands.exec("give @p "..Items[ID].." "..Amount[ID]) end
  13. end
  14.  
  15. function Menu()
  16. term.setBackgroundColor(colors.white)
  17. term.setTextColor(colors.black)
  18. term.clear()
  19. term.setCursorPos(1,1)
  20. print("Import Shop - everything for $100")
  21. end
  22.  
  23.  
  24. function Options()
  25. local n = 0
  26. local T = 1
  27. local a, b, c
  28. repeat
  29. for i = 1, #Items do
  30. term.setCursorPos(1,i + 1)
  31. if T == i then term.write(">> "..i.." - "..Items[i].." x"..Amount[i]) else term.write(i.." - "..Items[i].." x"..Amount[i]) end
  32. end
  33. a, b, c = os.pullEvent("key")
  34. if b == keys.w and T > 1 then T = T - 1 end
  35. if b == keys.s and T < #Items then T = T + 1 end
  36. if b == keys.enter then n = T end
  37. until n ~= 0
  38. Buy(n)
  39. end
  40.  
  41. start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement