Jump to content

[Help] ragrding code


Recommended Posts

hello all im trying to make this script work but im getting error

function top(data) 
 for i,theKey in pairs(data) do 
  local row = guiGridListAddRow(top10gridlist) 
   guiGridListSetItemText(top10gridlist, row, top10column1, theKey[i][1], false, false ) 
   guiGridListSetItemText(top10gridlist, row, top10column2, theKey[i][2], false, false ) 
   guiGridListSetItemText(top10gridlist, row, top10column3, theKey[i][3], false, false ) 

errors : attempt to index field'?'[a number  value] at line 5  guigridlistsetitemtext ...

whats the reason?

Edited by KINGKHAN
Link to post
theKey == data[i]

theKey[i] == data[i][i]

I believe you wanted to use

theKey[1], theKey[2], theKey[3]

rather than

theKey[i][1], theKey[i][2], theKey[i][3]


Edited by MrTasty
Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...