Making the Health update.

function scene:createScene( event ) local group = self.view local lives = 5 local question = display.newText ("What is your question?", 0, 0, native.systemFont, 18) question.x = display.contentCenterX question.y = display.contentCenterY local livesLabel = display.newText("Lives:" ..tostring(lives), 10, 30, native.systemFont, 16) livesLabel.x = display.contentCenterX +100 livesLabel.y = display.contentCenterY - 200 livesLabel:setTextColor(225,225,225) local bgImage = display.newText ("Lose 1 Health", 0, 0, native.systemFont, 18) bgImage.x = display.contentCenterX - 100 bgImage.y = display.contentCenterY - 200 local function bgTap( event ) lives = lives - 1 end bgImage:addEventListener("tap", bgTap ) group:insert( bgImage ) end

I made the local lives = 5

I made the local livesLabel show the current lives. I made the local bgImage as the button to lose 1 health.

I made a function that gets rid of 1 health everytime you click it. But when I click it the health doesnt change

edit:

I added         print(“Lives Left:” … lives)

and in the console it shows the lives decreasing by one every time I press the button. How do I make the text of where it shows the live update?

local function bgTap( event )
     lives = lives - 1

     livesLabel.text = “Lives:” …tostring(lives)
end

local function bgTap( event )
     lives = lives - 1

     livesLabel.text = “Lives:” …tostring(lives)
end