Advertisement
colhaydutu

atm9 the dead king

Jan 23rd, 2024 (edited)
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. local entities = peripheral.wrap("left")
  2.  
  3. if entities == nil then
  4. print("Peripheral not found on the right side. Program will continue without it.")
  5. end
  6.  
  7. while true do
  8. redstone.setOutput("right", false)
  9.  
  10. if entities then
  11. local scannedEntities = entities.scanEntities(13)
  12.  
  13. for _, entity in ipairs(scannedEntities) do
  14. if entity.name == "The Dead King" then
  15. redstone.setOutput("right", true)
  16. print(entity.name)
  17. sleep(5)
  18. else
  19. redstone.setOutput("right", false)
  20. sleep(0.1)
  21. print("Found entity with name: " .. entity.name)
  22. end
  23. end
  24. end
  25.  
  26. sleep(0.1)
  27. end
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement