Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.find("monitor")
- local x,y = mon.getSize()
- mon.setBackgroundColor(colors.blue)
- mon.clear()
- local xC,yC = math.floor((x+1)/2),math.floor((y+1)/2)
- term.clear()
- paintutils.drawLine(5,3,26,3,colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos(5,3)
- term.write("Quel joueur détecter ?")
- paintutils.drawLine(5,5,14,5,colors.lightGray)
- term.setTextColor(colors.lightBlue)
- term.setCursorPos(5,5)
- local name = read()
- mon.setCursorPos(xC-14,yC-2)
- mon.setTextColor(colors.yellow)
- mon.write(name.." se trouve à blocs")
- while true do
- local i = 1
- while not commands.exec("/testfor @a[name="..name..",r="..i.."]") do
- i = i + 1
- end
- term.setCursorPos(5,7)
- term.setBackgroundColor(colors.black)
- print(" ")
- term.setCursorPos(5,7)
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.lime)
- print(name.." est à "..tostring(i).." blocs.")
- mon.setCursorPos((xC-14)+string.len(name)+14,yC-2)
- mon.write(" ")
- mon.setCursorPos((xC-14)+string.len(name)+14,yC-2)
- mon.setTextColor(colors.orange)
- mon.write(tostring(i))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement