Posted 23 November 2014 - 04:35 AM
Can someone please tell me how I can make the computer not print if there are no players nearby?
glass = peripheral.wrap("right")
p = peripheral.wrap("left")
a = p.getPlayerNames()
glass.clear()
glass.addBox(1,1,100,50,0xFFFFFF,0.2)
c = 4
while true do
if c == 44 then
glass.clear()
glass.addBox(1,1,100,50,0xFFFFFF,0.2)
c = 4
end
sleep(3)
a = p.getPlayerNames()
for i=1,#a do
glass.addText(2, c, a, 0x000000)
end
c = c + 8
end
If there are no players nearby it just prints a blank space. I want it to print just player names and nothing extra
glass = peripheral.wrap("right")
p = peripheral.wrap("left")
a = p.getPlayerNames()
glass.clear()
glass.addBox(1,1,100,50,0xFFFFFF,0.2)
c = 4
while true do
if c == 44 then
glass.clear()
glass.addBox(1,1,100,50,0xFFFFFF,0.2)
c = 4
end
sleep(3)
a = p.getPlayerNames()
for i=1,#a do
glass.addText(2, c, a, 0x000000)
end
c = c + 8
end
If there are no players nearby it just prints a blank space. I want it to print just player names and nothing extra