# Duplication issues

**URL:** <https://forum.kirupa.com/t/duplication-issues/330953>\
**Category:** Uncategorized\
**Created:** [April 16, 2013, 4:17pm UTC](https://forum.kirupa.com/t/duplication-issues/330953 "2013-04-16T16:17:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nerdpocalypse](https://avatars.discourse-cdn.com/v4/letter/n/8797f3/32.png) [@nerdpocalypse](https://forum.kirupa.com/u/nerdpocalypse)\
**Post date:** [April 16, 2013, 4:17pm UTC](https://forum.kirupa.com/t/duplication-issues/330953/1 "2013-04-16T16:17:32Z")

</div>

I am making a digital version of a Zombie board game for fun, but have run into some issues with duplication of the pieces. I got these scripts online, and have modified them to suit my needs.  
There are 3 enemy types, and when you click each button it duplicates a MC off stage and places it in a box for you to click and drag to where you want it to be placed on the board. My issue is, when I spawn some of the first type (walkers), then spawn some of the second type (runners), it removes the walkers spawned from the stage one at a time. The same thing happens with the third type (fatties). If I spawn 5 walkers, 3 runners, and then go to spawn 8 fatties it will remove the previous enemies with each press of the fatty button like so: 1 runner,1 runner,1 runner, 1 walker, 1 walker, 1 walker, 1 walker, 1 walker, then I will have 8 fatties and no other enemies on the board.  
Any assistance would be great, my code is as follows:

On the Walker Button:

```auto
on (press){
    WalkerCount++;
    trace(WalkerCount);
}

on (release){
    //_root["Walker"+WalkerCount]._x = 1182.4;
    //_root["Walker"+WalkerCount]._y = 63;
    _root.Walker.duplicateMovieClip("Walker"+WalkerCount, WalkerCount);
    _root["Walker"+WalkerCount]._y=63;
    _root["Walker"+WalkerCount]._x=1145.2;
}

```

On the Runner Button:

```auto
on (press){
    RunnerCount++;
    trace(RunnerCount);
}

on (release){
    //_root["Runner"+RunnerCount]._x = 1182.4;
    //_root["Runner"+RunnerCount]._y = 63;
    _root.Runner.duplicateMovieClip("Runner"+RunnerCount, RunnerCount);
    _root["Runner"+RunnerCount]._y=128;
    _root["Runner"+RunnerCount]._x=1145.2;
}

```

On the Fatty Button:

```auto
on (press){
    FattyCount++;
    trace(FattyCount);
}

on (release){
    //_root["Fatty"+FattyCount]._x = 1182.4;
    //_root["Fatty"+FattyCount]._y = 63;
    _root.Fatty.duplicateMovieClip("Fatty"+FattyCount, FattyCount);
    _root["Fatty"+FattyCount]._y=193;
    _root["Fatty"+FattyCount]._x=1145.2;
}

```

And for good measure, my drag and drop code on each of the off stage MCs:

```auto
onClipEvent (load) {
this.onPress=function(){
startDrag(this);
trace (this._name);
}
this.onRelease=this.onReleaseOutside=function(){
stopDrag();
}
}

```

Also, to note, the WalkerCount, RunnerCount, and FattyCount are globally declared variables on the main timeline:

```auto
_global.WalkerCount;
_global.WalkerCount = 0
_global.RunnerCount;
_global.RunnerCount = 0
_global.FattyCount;
_global.FattyCount = 0

```

Thanks in advance for any assistance!
