Attempt to call global 'gameover' (a table value)

So i’m working on a little game using onCollision event’s :

    local function onCollision(event)     if event.phase == "began" and gameIsActive == true then     local obj1 = event.object1;      local obj2 = event.object2;             if obj1.name == "bill" then             if     obj2.name == "rocks" then gameover()             elseif obj2.name == "" then              end         end     end     end     Runtime:addEventListener( "collision", onCollision )

But i have a bit of a problem the code works as expected the first time it runs but is you restart the game i’m getting this error :

&nbsp; &nbsp; File: game.lua&nbsp; &nbsp; &nbsp; Line: 649&nbsp; &nbsp; &nbsp; Attempt to call global 'gameover' (a table value)&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; stack traceback: game.lua:649: in function \<game.lua:643\> ?: in function \<?:221\> &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; 649 = if obj2.name == "rocks" then gameover() &nbsp; &nbsp; &nbsp; 643 = local function onCollision(event

)

Any idea what this could be?

gameover function :

&nbsp; &nbsp; function gameover() &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; rightTAP:removeEventListener("tap", movePLAYERr)&nbsp; &nbsp; &nbsp; leftTAP:removeEventListener("tap", movePLAYERl)&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; timer.pause(spawnBits) &nbsp; &nbsp; timer.pause(Rockspawner1) &nbsp; &nbsp; timer.pause(tmrscore) &nbsp; &nbsp; timer.pause(updateScoretimer) &nbsp; &nbsp; timer.pause(spawnDinosControll) &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; audio.pause( drillingChannel ) &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; drillbg.isVisible = false &nbsp; &nbsp; scoreText.isVisible = false &nbsp; &nbsp; Restartg = display.newText( "Restart", 0, 0,nil, 20) &nbsp; &nbsp; Restartg:setFillColor(0, 0, 0) &nbsp; &nbsp; screenGroup:insert(Restartg) &nbsp; &nbsp; Restartg.x= display.contentWidth/2 &nbsp; &nbsp; Restartg.y= display.contentHeight/2 + 160 &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; Restartg:addEventListener("tap", RestartGame1) &nbsp; &nbsp; end

fixed by adding “transition.pause( thisRock )” to the gameover function

fixed by adding “transition.pause( thisRock )” to the gameover function