Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sensor = peripheral.wrap("top")
- local players = sensor.getPlayers()
- for k, v in pairs(players) do --# start a generic loop
- print(k , " / " , v) --# print each key/value pair in the table
- if type(v) == "table" then --# if the value is another table, then iterate though that table
- for i, n in pairs(v) do --# start another generic loop
- print(i , " / " , n) --# print each key/value pair in the table
- end
- end
- end
- pdata = sensor.getPlayerByName("jc2xs").basic().position
- for k, v in pairs(pdata) do --# start a generic loop
- print(k , " / " , v) --# print each key/value pair in the table
- if type(v) == "table" then --# if the value is another table, then iterate though that table
- for i, n in pairs(v) do --# start another generic loop
- print(i , " / " , n) --# print each key/value pair in the table
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment