Count Down on a clickable button

TyDietrichTyDietrich Member Posts: 45
edited May 2014 in Working with GS (Mac)

Hey everyone, i have a button that is pressed to fire bullets in the game. Currently I have a display text in the button that shows how many bullets i have. The only problem I'm having is that when i continue to click the button when my bullet count is zero the numbers start to go negative (0,-1,-2, etc.). I want it so nothing happens when you click on the button and you have no ammo. (nothing happens past 0 if you continue to click the button).

Comments

  • joshiwujoshiwu Member Posts: 207

    use the script you have put together already but insert it in a rule that says if bullets > 0

  • DuesDues Member Posts: 1,159
    edited May 2014

    Or you could use an index attribute. That way when you have 0 bullets and press again i still will be zero. :)

  • TyDietrichTyDietrich Member Posts: 45

    Thanks Dues that worked

  • DuesDues Member Posts: 1,159
    edited May 2014

    You are welcome :)

    Oh and when you want someone to know that you mentioned them in a post put an @ in front of their username like this: @TyDietrich‌ and they will be notified :)

Sign In or Register to comment.