# My lil game

**URL:** <https://forum.kirupa.com/t/my-lil-game/68425>\
**Category:** Uncategorized\
**Created:** [October 25, 2004, 9:23pm UTC](https://forum.kirupa.com/t/my-lil-game/68425 "2004-10-25T21:23:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![binime](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@binime](https://forum.kirupa.com/u/binime)\
**Post date:** [October 25, 2004, 9:23pm UTC](https://forum.kirupa.com/t/my-lil-game/68425/1 "2004-10-25T21:23:33Z")

</div>

well ive spent most of the afternoon touching up the game i want to create and so far it seems to be going well. however, the weapons! big problem! i have an inventory list and everything is working fine, except for one part.

```auto

_root.onEnterFrame = function() {
	if (Key.isDown(Key.END)) {
		weapon += 1;
		_root.currentWeapon = _root.weapons[weapon];
		_root.char.attachMovie(_root.currentWeapon, "weapon", 1);
		if (weapon>weapons.length) {
			_root.currentWeapon = _root.weapons[0];
		}
	}
	if (Key.isDown(Key.HOME)) {
		weapon -= 1;
		_root.currentWeapon = _root.weapons[weapon];
		_root.char.attachMovie(_root.currentWeapon, "weapon", 1);
		if (weapon>weapons.length) {
			_root.currentWeapon = _root.weapons[0];
		}
	}
};

```

now the only thing that doesnt work is the attachMovie. when pressing End or Home i want the gun from the variable to be attached to my main character whos Instance Name is “char”. everything works good apart from this. can anybody help me please? any help much appreciated  
~binime
