Jump to content




OpenPeripherals: Sensor documentation?


  • You cannot reply to this topic
3 replies to this topic

#1 austinv11

  • Members
  • 107 posts

Posted 01 May 2014 - 11:40 PM

I know how to get documentation in game, but I want more detail on the return of the getPlayerData() method. I know it returns a table, but I wanna know all the values in the table and such

#2 CometWolf

  • Members
  • 1,283 posts

Posted 01 May 2014 - 11:44 PM

It's silly that we have to do this, but use a pairs for loop to get the contents of the table.
for k,v in pairs(table) do
  print(k.." : "..v)
end


#3 austinv11

  • Members
  • 107 posts

Posted 01 May 2014 - 11:51 PM

View PostCometWolf, on 01 May 2014 - 11:44 PM, said:

It's silly that we have to do this, but use a pairs for loop to get the contents of the table.
for k,v in pairs(table) do
  print(k.." : "..v)
end
i know that, but the table has tables in it, and that table has tables in it, its all really confusinng and I don't know what some of the return values are for. Health? Coords? Idk

#4 CometWolf

  • Members
  • 1,283 posts

Posted 01 May 2014 - 11:55 PM

You're using a sensor, what do you think coords and health is...?
Just look at the results of the loop and use your head. If you know an index holds a table, then loop that instead.
for k,v in pairs(table.index) do
  print(k.." : "..v)
end






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users