Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local entities = peripheral.wrap("left")
- if entities == nil then
- print("Peripheral not found on the right side. Program will continue without it.")
- end
- while true do
- redstone.setOutput("right", false)
- if entities then
- local scannedEntities = entities.scanEntities(13)
- for _, entity in ipairs(scannedEntities) do
- if entity.name == "The Dead King" then
- redstone.setOutput("right", true)
- print(entity.name)
- sleep(5)
- else
- redstone.setOutput("right", false)
- sleep(0.1)
- print("Found entity with name: " .. entity.name)
- end
- end
- end
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement