How to make limited amount of bullets an actor can shoot

Hey guys ,

Thanks to those that helped me last time . Anyway , Im trying to make a game where actor 1 has to shoot actor 2 with a limited amount of bullets . I need help in making like after 5 shots , actor 1 cannot shoot anymore . Im not really sure how to make this . Pls help if u know
Tks

Comments

  • TosanuTosanu Member, PRO Posts: 388

    Make an attribute on Actor 1. Call it Bullet number and make it whatever number of bullets you want. Once you have it, on your Shooting command, add a wrapper rule If BulletNumber>0, and add the command Bulletnumber = bulletnumber- 1 as one of the behaviors within that rule.

  • MonsterzproductionsMonsterzproductions Member Posts: 66

    could u send a template ? I don't really understand .
    Tks

  • TosanuTosanu Member, PRO Posts: 388
    edited May 2014

    I'm afraid I dont have time to do a template, so I'll try typing it out quickly here. The shooting rule should look like this.

    If Integer.Bulletnumber >0

    ( If trigger is pulled(however you have the player fire, button or screen touch)

    Spawn Bullet

    Integer.Bulletnumber = Integer.Bulletnumber - 1)

    That way each time you fire, the number drops by one, and when it hits zero, you can no longer fire.

  • bjandthekatzbjandthekatz Orlando, FlMember Posts: 1,375

    Demo attached.

  • MonsterzproductionsMonsterzproductions Member Posts: 66

    Tks

Sign In or Register to comment.