Jump to content

'for' limit must be a number


Snoozy

Recommended Posts

Hey I've come across a problem with 'for' limit must be a number and have been unable to find a fix, anyhow heres the code and so on where it comes from

infoRoot = getElementByID("infoRoot") 
maxbi = getElementData(infoRoot,"MaxBusiness") 
for idx=1,maxbi do -- 'for' limit must be a number appears here 
triggerServerEvent ( "GetBizName", getLocalPlayer(),idx) 
end 

It have worked before which is why it just seems strange

local infoRoot = createElement("infoRoot", "infoRoot") 
    setElementData(infoRoot, "MaxBusiness",maxbi) 

This is where the data is set

Link to comment

Oh well I just found the problem when I was trying to explain when it happen :D Looking at the code I was about to put into this post I noticed the problem, it was that I created the infoRoot element twice, and it was after the MaxBusiness was defined so it got erased again lol

Link to comment

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...