It returns 2 blank spaces,
I used tostring() and, well, it displays nil and nil
p = peripheral.wrap("back")
lines = {a,b}
list = {p.getNearbyPlayers(100)}
for k,v in pairs(list) do
print(tostring(v.player))
print(tostring(v.distance))
end
end
I don't see where the problem is, eveything looks good :/
Sorry for double post, but I finally got it =), at least it works for one player.
p = peripheral.wrap("back")
lines = {a,b}
list = {}
list = p.getNearbyPlayers(100)
for k,v in pairs(list) do
print(tostring(v.player))
print(tostring(v.distance))
end
end
It works, I can choose to display only usernames, or only distances or do whatever I want with these variables =)
I'm going to test it on a multiplayer server and see if it works
(Sorry if it sounds a little bit repetitive, but English is not my native language ^^ )