Sign in to follow this  
Snoozy

'for' limit must be a number

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

Share this post


Link to post

Where? Just tried 2 different places but it didn't work?

Share this post


Link to post

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

Share this post


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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.