Game won't end when counter number goes above the set target number.. Help....

I have:

  • a number which is incremented by 1 every second (local seconds) using a timer calling a function named

seconds_counter

  • a button (local button)

  • a set number on the screen (local target)

I want to print(“you lose”) when the number which is incremented by 1 every second goes HIGHER than the set number.

I wrote:

if (seconds > target) then

    print (“you lose”)

end

But when the seconds rise above the target number, “you lose” does not show in the console. 

Most likely you need to do this check inside the function the timer is calling.  We really can’t help with out seeing the code.

Rob

Thankyou for your help I should have thought of that in the first place!!

Greatly appreciated.

Farid.

Most likely you need to do this check inside the function the timer is calling.  We really can’t help with out seeing the code.

Rob

Thankyou for your help I should have thought of that in the first place!!

Greatly appreciated.

Farid.