This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
LuffyNL's profile picture

OpenPeripheral sensor returning empty tables?

Started by LuffyNL, 04 January 2016 - 05:30 PM
LuffyNL #1
Posted 04 January 2016 - 06:30 PM
When using the getPlayerByName function I get a table, within this table there are a few other but these all seem to be empty.

sensor = peripheral.wrap("top")
info = sensor.getPlayerByName("LuffyNL")
pos = info.position
This small snippet returns nil when trying to look at the contents of position
I am using the all in one version of openperipherals OpenPeripheral-1.7.10-AIO-5 but didn't see any fixes in the changelog for version 6 nor any other bugreports about this issue. Is this just me messing up? Any help is greatly appreciated
Lupus590 #2
Posted 04 January 2016 - 06:56 PM
is there a player with that name online? is the player in range of the sensor?
LuffyNL #3
Posted 04 January 2016 - 08:10 PM
I found the problem, for some reason I needed to call info.all().position, I still don't fully understand why though so if someone has an explanation that would be great :)/>