Load gameover.lua when lives hit 0

how can i load my gameover.lua when lives ==0??

local function killbug (event)
bug.alpha = 0
lives = lives - 1
if lives == 2 then
heart3.isVisible = false
end

if lives == 1 then
heart3.isVisible = false
heart2.isVisible = false
end

local blood = display.newImage (“blood.png”)
transition.to( blood, { time=500, delay=3000, alpha=0 } )
blood.x = bug.x
blood.y = bug.y
score.setScore( score.getScore() + 100)
if lives == 0 then

end
end

bug:addEventListener(“touch”, killbug) [import]uid: 10827 topic_id: 4824 reply_id: 304824[/import]

For future reference, put these tags before and after your code because it is really hard to read code without formatting:
< code >
< /code >

Second and more pertinent to your question, how you load gameover.lua depends on what it does. We can’t possibly tell you what to do with it without knowing what’s in it.

That’s really the wrong question to be asking though. You’re assuming that you even want to load gameover.lua (whatever that is.) What you should do is describe what happens when the player runs out of lives and then ask how to do that. [import]uid: 12108 topic_id: 4824 reply_id: 15475[/import]

try using the director class [import]uid: 11930 topic_id: 4824 reply_id: 15500[/import]

yeahh i figured it out, thanks. [import]uid: 10827 topic_id: 4824 reply_id: 15505[/import]