Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Open door if radar see player
- --Beelzebub dreamfinity Technocracy for City17
- ----[ Библиотеки ]----
- local component = require("component")
- local sides = require("sides")
- local term = require("term")
- ----[ Константы ]----
- local gpu = component.gpu
- ----[ Код ]----
- --gpu.setResolution(35,10)
- gpu.setResolution(140,40)
- -- Цвета --
- color = {
- green = 0x00ff00,
- yellow = 0xffb600,
- red = 0xff0000
- }
- -- Белый список ---
- white = {
- Beelzebub = true,
- rrr_game = true,
- AlexeyRepin = true,
- RedMaster12341 = true
- }
- while true do
- local sensor = component.radar.getPlayers()
- for i = 1, #sensor do
- if white[sensor[i].name] then
- if sensor[i].distance <= 4 then
- component.redstone.setOutput(sides.up,0)
- gpu.setForeground(color.green)
- else
- component.redstone.setOutput(sides.up,15)
- gpu.setForeground(color.red)
- end
- term.clear()
- print(sensor[i].name)
- print(sensor[i].distance)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment