# RPG help

**URL:** https://forum.kirupa.com/t/rpg-help/65338
**Category:** programming
**Created:** [September 25, 2004, 4:43am UTC](https://forum.kirupa.com/t/rpg-help/65338 "2004-09-25T04:43:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Mazzy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mazzy/32/770_2.png) [@Mazzy](https://forum.kirupa.com/u/Mazzy)
#### Post date: [September 25, 2004, 4:43am UTC](https://forum.kirupa.com/t/rpg-help/65338/1 "2004-09-25T04:43:58Z")

</div>

this is the code on my first frame by i dont get why the attack bit at the bottom dosen’t work

```auto
MovieClip.prototype.moveMan = function(moveX, moveY, facing)
{
 if(_global.aniMation == 9)
 {
  _global.animation = 1;
 }
 else
 {
  _global.aniMation++;
 }
 currentFacing = (facing * 9) + _global.aniMation;
 this.gotoAndStop(currentFacing);
 this._x += moveX;
 this._y += moveY;
}
_root.onEnterFrame = function()
{
 if(Key.isDown(Key.DOWN))
 {
  walkingMarz.moveMan(0, 9, 0);
 }
 if(Key.isDown(Key.UP))
 {
  walkingMarz.moveMan(0, -9, 1);
 }
 if(Key.isDown(Key.RIGHT))
 {
  walkingMarz.moveMan(9, 0, 2);
 }
 if(Key.isDown(Key.LEFT))
 {
  walkingMarz.moveMan(-9, 0, 3);
 }
 if (Key.isDown(Key.SPACE)) {
	walkingMarz.gotoAndStop("attack");
	walkingMarz.attack.play(1);
	} 
}
_root.onLoad = function()
{
 _global.aniMation = 1;
}  

```

---

<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 26, 2004, 5:03pm UTC](https://forum.kirupa.com/t/rpg-help/65338/2 "2004-09-26T17:03:20Z")

</div>

To use that portion of the code… You have to set up the walkingMarz movieclip with a frame called “attack” and then play a movieclip contained in the attack frame called attack.
