# Weapons Selection Problem!

**URL:** <https://forum.kirupa.com/t/weapons-selection-problem/278100>\
**Category:** flash\
**Created:** [December 22, 2008, 3:12pm UTC](https://forum.kirupa.com/t/weapons-selection-problem/278100 "2008-12-22T15:12:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alleballe90](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@alleballe90](https://forum.kirupa.com/u/alleballe90)\
**Post date:** [December 22, 2008, 3:12pm UTC](https://forum.kirupa.com/t/weapons-selection-problem/278100/1 "2008-12-22T15:12:53Z")

</div>

So basically what I want is a weapons selection option in my game, for example; press 1 and use the Pistol, press 2 and use the Uzi. Here is the code I’ve put in the timeline

[SIZE=1]\_root.wpnChoice = 0;[/SIZE]  
[SIZE=1][/SIZE]  
[SIZE=1]//DESERT EAGLE[/SIZE]  
[SIZE=1]if (\_root.wpnChoice == 0) {  
\_root.shootspeed = 55;  
\_root.armorPierce = 0;  
\_root.crosshair.\_alpha = 60;  
}[/SIZE]  
[SIZE=1]//UZI  
if (\_root.wpnChoice == 1) {  
\_root.shootspeed = 100;  
\_root.armorPierce = 0;  
\_root.crosshair.\_alpha = 60;  
}[/SIZE]  
[SIZE=1][/SIZE]  
If I change the \_root.wpnChoice = 0 to 1 it works fine, but if i make a button or something in game and use

[SIZE=1]on (release) {  
\_root.wpnChoice = 1  
}[/SIZE]  
[SIZE=1][/SIZE]  
It doesn’t work… I’m guessing it has something to do with that the game isn’t updating frequently or something. PLEASE HELP!! :\*(

[SIZE=1]  
[/SIZE]
