array message error , help needed

Hi,

I have a series of bases (4 in total), each base is made up of 40 blocks.

The issue is they are fine and working when I run the game.

However when I destroy the blocks/bases and move on to another level, they display ok and work ok but at a specific point in the game I get a

Array index “number” is beyond array bounds:1…0

Array index “number” is beyond array bounds:1…1 etc etc

This will continue up to:

Array index “800” is beyond array bounds:1…159

then the game will play until it reaches the next point then the same again starting at the last array index"800" etc

but this time up to:

Array index “4000” is beyond array bounds:1…159

The error is pointing me here:

[lua]  blockGroup:insert(blockNum,self.block) [/lua]

but it is correct, any help suggestions pointers would be very much appreciated.

I am sorry to be vague , but its the best I can describe it

We probably are going to need to see more code.  But basically you are trying to index a value that isn’t in the array.  You have 159 items in your array (1 thru 159) and you’re trying to access somearray[800] which doesn’t exist.

We probably are going to need to see more code.  But basically you are trying to index a value that isn’t in the array.  You have 159 items in your array (1 thru 159) and you’re trying to access somearray[800] which doesn’t exist.