Weapons Switch Button

I have a actor using a shotgun and also a sub machine gun. I tried to make a button on the game scene that shows a shotgun but when pressed it changes to the sub machine gun and the actor does also. I uploaded pictures of my code. I changed the attribute to (game.Weapons-1)%2. with Weapons being a integer of 1. Thank you.

Answers

  • Luke20wLuke20w Member, PRO Posts: 50

    The second picture of code looks good but it would be simpler if you just made two rules. 1) If game.weapons=1 and key A is pressed change game.weapons to 2
    2) If game.weapons=2 and key A is pressed change game.weapons to 1
    Hope this helps!

  • Luke20wLuke20w Member, PRO Posts: 50

    And i have been trying to upload picture for a while but I couldn't figure it out how did you do that?

  • derka6391derka6391 Member Posts: 31

    drag and drop. How would the attribute increment without a change attribute?

  • derka6391derka6391 Member Posts: 31

    I did what you said and it didnt work, uploaded pictures.

Sign In or Register to comment.