Advertisement
Cardwell

LaserDrage

Apr 1st, 2021
997
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. local redspawner = "right"
  2. local redlaser = "back"
  3. local input = "left"
  4.  
  5. ps = "a"
  6.  
  7. local spawner = 5
  8. local laser = 1
  9.  
  10. while true do
  11. term.setBackgroundColor(colors.black)
  12. term.clear()
  13. term.setCursorPos(1,1)
  14. write(" Skriv a og trykk ENTER for å starte greia ")
  15. local input = read()
  16.  
  17. if input == ps
  18. then term.clear()
  19. term.setCursorPos(1,1)
  20. print("Venter på laser...")
  21. os.pullEvent("redstone")
  22.  
  23. if
  24. rs.getInput("left") then
  25.  
  26. term.clear()
  27. term.setCursorPos(1,1)
  28. print("laser klar!")
  29. sleep(2)
  30. term.clear()
  31. print("Aktiverer om...")
  32. sleep(2)
  33. term.clear()
  34. print("3")
  35. sleep(1)
  36. print("2")
  37. sleep(1)
  38. print("1")
  39. sleep(1)
  40. term.clear()
  41. term.setBackgroundColor(colors.red)
  42. term.clear()
  43. term.setCursorPos(1,1)
  44. print("AKTIV!")
  45. rs.setOutput(redspawner,true)
  46. sleep(spawner)
  47. rs.setOutput(redspawner, false)
  48. rs.setOutput(redlaser, true)
  49. sleep(laser)
  50. rs.setOutput(redlaser, false)
  51.  
  52. else
  53. print("ERROR")
  54. sleep(3)
  55.  
  56. end
  57. end
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement