Belzebub

Close door if radar see player.lua

Apr 9th, 2018
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Close door if radar see player
  2. --Программа призвана заменить дуратские нажимные плиты
  3. --В комнатах с бесплатными механизмами на варпах)
  4. --Автор Vanilla_ mcskill tmcraft 2018
  5. --Большое спасибо utevaugu36 :)
  6. ----[ Библиотеки ]----
  7. local component = require("component")
  8. local sides = require("sides")
  9. local term = require("term")
  10. ----[ Константы ]----
  11. local sensor = component.openperipheral_sensor
  12. local gpu = component.gpu
  13. local modem = component.modem
  14. ----[ Код ]----
  15. gpu.setResolution(35, 10)
  16. --gpu.setResolution(140,40)
  17. term.clear()
  18. modem.open(999)
  19. gpu.set(20,10,"Made by:Vanilla_")
  20.  
  21. while true do
  22.   player = sensor.getPlayers()
  23.   local _,_,_,_,_,nick = require"event".pull(1)
  24.   gpu.setForeground(0x00FF00)
  25.   gpu.set(1, 1, "Здесь сейчас находятся:")
  26.   coord = 0
  27.   for i = 1, #player do
  28.     gpu.setForeground(0xFF0000)
  29.     gpu.set(1, 2 + coord, player[i].name)
  30.     coord = coord + 1
  31.   end
  32.   if nick ~= nil then
  33.      gpu.set(1, 2 + coord, nick)
  34.   end
  35.   if player[1] ~= nil or nick ~= nil then
  36.     component.redstone.setOutput(sides.up, 15)
  37.   else
  38.     component.redstone.setOutput(sides.up, 0)
  39.    end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment