Trying to build a 9mm I got an m16?

LordTarantorLordTarantor Member, PRO Posts: 890
edited November -1 in Working with GS (Mac)
Ok If I step in the zone the enemy is supposed to shoot me once but instead it shoot a lot and if I stay in the zone it keep shooting like crazy.
What I want is when I step in the zone the enemy shoot me only 1 bullet.
Please help.

Comments

  • expired_012expired_012 Member Posts: 1,802
    Just one method... Make a big invisible box ( this is basically your zone) and when your main actor collides with it, ( this is where attributes come in). You can use a timer for when the actor takes step in the zone one bullet shoots out and after how many seconds spawn a lot of bullets. Obviously this isn't a full answer since i am a bit in a rush right now but it could be a start :)
  • firemaplegamesfiremaplegames Member Posts: 3,211
    The gun needs to have a boolean attribute called something like 'OKToShoot'.
    Set it initially to true.

    Whenever the gun shoots a bullet, set this to false and start a Timer to set it back to true.

    Like this:

    Rule
    When all conditions are valid:
    [player is in range]
    self.OkToShoot = true
    -----Spawn Actor [bullet]
    -----Change Attribute: self.OKToShoot To: false
    -----Timer: for 1 second: run to completion
    ----------Change Attribute: self.OKToShoot To: true

    The delay of the Timer determines the reload time.

    Hope this helps!
    Joe
  • LordTarantorLordTarantor Member, PRO Posts: 890
    Thanks Joe that was pure awesomeness...
Sign In or Register to comment.