# Hey guys i need some help for a weapon system

**URL:** <https://forum.kirupa.com/t/hey-guys-i-need-some-help-for-a-weapon-system/65806>\
**Category:** Uncategorized\
**Created:** [September 29, 2004, 6:28pm UTC](https://forum.kirupa.com/t/hey-guys-i-need-some-help-for-a-weapon-system/65806 "2004-09-29T18:28:47Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolmarco2004x](https://avatars.discourse-cdn.com/v4/letter/c/e9c0ed/32.png) [@coolmarco2004x](https://forum.kirupa.com/u/coolmarco2004x)\
**Post date:** [September 29, 2004, 6:28pm UTC](https://forum.kirupa.com/t/hey-guys-i-need-some-help-for-a-weapon-system/65806/1 "2004-09-29T18:28:47Z")

</div>

hi,  
i have a problem  
im making a gta style game with birds view and the battle system is the same so…  
the problem is if you buy a pistol and afterwards a bazooka and you want to change from pistol to bazooka(by pressing D)it goes to the next weapon thats the uzi but actually you didnt buy the uzi!  
so my question is:How do you make a weapon system like in GTA?  
thanks for reading  
and PLZ Help  
thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 29, 2004, 6:33pm UTC](https://forum.kirupa.com/t/hey-guys-i-need-some-help-for-a-weapon-system/65806/2 "2004-09-29T18:33:47Z")

</div>

I think we are going to need a bit more information if we are going to help you… We don’t know ANYTHING about your code, so how could we possibly know why the uzi is coming up instead of the bazooka?? lets see some code!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 29, 2004, 6:34pm UTC](https://forum.kirupa.com/t/hey-guys-i-need-some-help-for-a-weapon-system/65806/3 "2004-09-29T18:34:53Z")

</div>

well actually my question is only how to do a weapon system  
anyways its easier chatting  
my msn messenger is [coolmarco2003x@hotmail.com](mailto:coolmarco2003x@hotmail.com)  
thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 29, 2004, 9:19pm UTC](https://forum.kirupa.com/t/hey-guys-i-need-some-help-for-a-weapon-system/65806/4 "2004-09-29T21:19:20Z")

</div>

That is still a pretty general question. There isn’t ONE way to make a weapon system that is just going to work for every single game. It would be almost impossible for someone to just know exactly what you want. The best way to get a response here is to show us some code that you are having trouble with, just so there is something to work with. We can’t just explain ‘how to do a weapon system’.

and I don’t use msn 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 30, 2004, 5:33am UTC](https://forum.kirupa.com/t/hey-guys-i-need-some-help-for-a-weapon-system/65806/5 "2004-09-30T05:33:40Z")

</div>

okay

i just do this

[font=Courier New]if(Key.isDown([\ he](file:// he) key for the next weapon)[/font]  
[font=Courier New]NextFrame()[/font]  
[font=Courier New])[/font]  
[font=Courier New]if(Key.isDown([\key](file://\key) for the weapon before)[/font]  
[font=Courier New]PreviousFrame()[/font]  
[font=Courier New])[/font]  
[font=Courier New])[/font]  
[font=Courier New][/font]  
[font=Courier New]now could someone help?[/font]  
[font=Courier New]thanks[/font]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 30, 2004, 5:57am UTC](https://forum.kirupa.com/t/hey-guys-i-need-some-help-for-a-weapon-system/65806/6 "2004-09-30T05:57:46Z")

</div>

You’re going to need to set an array of weapons you have, and scroll through the array instead.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 30, 2004, 9:12am UTC](https://forum.kirupa.com/t/hey-guys-i-need-some-help-for-a-weapon-system/65806/7 "2004-09-30T09:12:08Z")

</div>

No offense here man, but that isn’t even the correct syntax for an if statement. I don’t know that you should be trying to take on something like a game just yet. If you want help, you are actually going to have to attempt to make this and post the .fla or some REAL code from your attempt. There is really no other way for anyone to help you. Dreeft has a point, you would probably want to store an array of the weapons. Where this array would be? Who knows - we have no idea how your game is set up. All we can do is offer some very very general statements, like they should be stored in an array.

You would probably need a list of weapons (an array or object). You would need properties for each weapon (how much damage each weapon does, how much ammo each weapon holds at once, firing rate, etc…). Some firing code for each weapon (a function to fire each different weapon). You would need a graphic file for each weapon - each stored in it’s own movieclip, or a “weapons” movieclip with one frame for each weapon (it seems like this is what you were trying to do from the code above).

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 30, 2004, 5:00pm UTC](https://forum.kirupa.com/t/hey-guys-i-need-some-help-for-a-weapon-system/65806/8 "2004-09-30T17:00:27Z")

</div>

well  
my weapon system should be like this:  
A=revious Weapon,D=Next Weapon  
Now thats how it works  
GTA Style  
just write down how to make a weapon system  
thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 1, 2004, 8:42am UTC](https://forum.kirupa.com/t/hey-guys-i-need-some-help-for-a-weapon-system/65806/9 "2004-10-01T08:42:10Z")

</div>

> just write down how to make a weapon system  
> no offense but noones going to do that! i’ve heard that most ppl will only help those that help themselves, but if u have no idea i’ll give u some pointers.  
> i’m not quite sure how u’d select them out of an array, but assuming u don’t know about an array, have array:  
> weaponsArray = new Array();  
> //initial array  
> weaponsArray = [“hands”, “pistol”];

and then if u pick up a weapon:  
//sorry can’t remember how to add things to array of the top  
//of my head, and i’m at school!

then to go forwards in the array with a key press:  
//weapon is variable  
/this is initial  
weaponNumber = 0;  
then on key press  
weaponNumber += 1;  
then at the end u would have:  
myWeapon = weaponsArray[weaponNumber];

then at the end somewhere have  
where weapon is a mc with instance weapon  
and has pistol frame label pistol  
if(myWeapon == "pistol){  
\_root.weapon.gotoAndPlay(“pistol”);  
}  
etc.

have this all in main timeline under a \_root.onEnterFrame = function(){};

this should get u started

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 1, 2004, 5:26pm UTC](https://forum.kirupa.com/t/hey-guys-i-need-some-help-for-a-weapon-system/65806/10 "2004-10-01T17:26:27Z")

</div>

> [@coolmarco2004x](#):
>
> well  
> my weapon system should be like this:  
> A=revious Weapon,D=Next Weapon  
> Now thats how it works  
> GTA Style  
> just write down how to make a weapon system  
> thanks

You’ve got to be kidding, this is ridiculous.

Is this guy a troll or what?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 2, 2004, 3:00am UTC](https://forum.kirupa.com/t/hey-guys-i-need-some-help-for-a-weapon-system/65806/11 "2004-10-02T03:00:50Z")

</div>

Well u have to assume he just learnt how to turn the on key of his computer, was surprised it started up, then discovered he had flash, and has lots of ideas but no knowledge (no offense)
