Advertisement
placeurtexthere

counter.lua

Jan 24th, 2021
1,022
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print("I'm working! Hopefully...")
  2. local pop = 10
  3. local add = redstone.getInput("right")
  4. while true do
  5.     function display(population)
  6.         local mon = peripheral.wrap("left")
  7.         mon.clear()
  8.         mon.setCursorPos(1,1)
  9.         mon.setTextScale(2)
  10.         mon.write("Current villager population is: "..population)
  11.     end
  12.     print("func 1.")
  13.     function light()
  14.         redstone.setOutput("top", true)
  15.         sleep(0.01)
  16.         redstone.setOutput("top", false)
  17.     end
  18.     print("func 2.")
  19.     if add==true then
  20.         pop=pop+1
  21.         print("add")
  22.         light()
  23.         display(pop)
  24.     end
  25.     print("if")
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement