# Spawing NPC's/Allies movieClipDuplicate Help

**URL:** <https://forum.kirupa.com/t/spawing-npcs-allies-movieclipduplicate-help/282757>\
**Category:** programming\
**Created:** [February 26, 2009, 2:52am UTC](https://forum.kirupa.com/t/spawing-npcs-allies-movieclipduplicate-help/282757 "2009-02-26T02:52:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Outmodeduser](https://avatars.discourse-cdn.com/v4/letter/o/b487fb/32.png) [@Outmodeduser](https://forum.kirupa.com/u/Outmodeduser)\
**Post date:** [February 26, 2009, 2:52am UTC](https://forum.kirupa.com/t/spawing-npcs-allies-movieclipduplicate-help/282757/1 "2009-02-26T02:52:46Z")

</div>

Hello! I am working on a Beta for a game similar to armor alley, the Beta is basically me proving to myself i could actually make a game, but i digress. There is a movieClip on the stage that is a button you press (movieClip, not a button though) to deploy new Infantry, refrenced as “inf”. Here is the following code on the button. Note onClipEnterframe ect is there, im not that dumb. Will it help to upload and .fla? Any help would be greatly apreciated! Thanks!

```auto
dupMovie = function () {
	i = 0
	newInf = _root.inf.duplicateMovieClip("infspanw"+i, i++); //probly bad code :(
	newInf._x = Stage.width/1.3 //Just some point
	i++;
	if (i>25) {
		i = 0
	}
}
}
on (press) {
	dupMovie();
}

```
