And this one:
buttons=display.newGroup() --stuff local function playerItems(event) if ( event.phase == "ended" ) then if(t.item1==true)then b\_item1=display.newImageRect("PNG/blaster\_icon.png",70,70) else b\_item1=display.newImageRect("PNG/unknown\_icon\_1.png",70,70) end b\_item1.x=280 b\_item1.y=800 if(t.item2==true)then b\_item2=display.newImageRect("PNG/flamethrower\_icon.png",70,70) else b\_item2=display.newImageRect("PNG/unknown\_icon\_2.png",70,70) end b\_item2.x=360 b\_item2.y=800 buttons:insert(b\_item1) \<-------------------- attempt to index global 'buttons'(a nil value) buttons:insert(b\_item2) end end