jonassvensson4

Untitled

Sep 20th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. local sensor = peripheral.wrap("top")
  2. local players = sensor.getPlayers()
  3. for k, v in pairs(players) --# start a generic loop
  4.   print(k .. " / " .. v) --# print each key/value pair in the table
  5.   if type(v) == "table" then --# if the value is another table, then iterate though that table
  6.     for i, n in pairs(v) do --# start another generic loop
  7.       print(i .. " / " .. n) --# print each key/value pair in the table
  8.     end
  9.   end
  10. end
Add Comment
Please, Sign In to add comment