Urgent! duplicateMovieClip! Why do scripts not work on copies of an mc!

Here’s what I have set up. I have a player mc shooting bullets in a game. Naturally you need the duplicate mc to do this. A little farther away I have an enemy mc with the following script in it:

[AS]onClipEvent (enterFrame) {
if (_root.shell.hitTest(_root.bad)) {
_root.ehealth.nextFrame();
}
}
[/AS]

It’s supposed to make the ehealth, the enemies health play upon contact with my bullet “shell”. Well that’s all very good and the script is perfect, but it only relates to the first bullet my guy shoots! Does anyone know why this is happening and how I can fix this. If anyone knows the answer It would be a huge help…This problem has put a large roadblock in my progress. I’ve attached the shooting script I’ve been using as well. Thanks in advance, I really need to know this!

[AS]
onClipEvent (enterFrame) {
if (Key.isDown(Key.CONTROL)) {
shellCounter++;
_root.shell.duplicateMovieClip(“shell”+shellCounter, shellCounter);
_root[“shell”+shellCounter]._visible = true;
}
}
[/AS]
As well does anyone know how I can put a stopper on that script so the user can only shoot one bullet at a time instead of a whole string of them. Thanks again! :slight_smile:

Thanks for your answer. But It’s still not working. Could you give me a fla example maybe. The code I’m using to remove it right now is this.

[AS]
onClipEvent (enterFrame) {
this._x += shellMoveSpeed;
if (this._x>550) {
this.removeMovieClip();
checkShell = “done”;
}
}
[/AS]

And this is the my updated shooting script.

[AS]
onClipEvent (enterFrame) {
if (checkShell == “done”) {
if (Key.isDown(Key.CONTROL)) {
shellCounter++;
_root.shell.duplicateMovieClip(“shell”+shellCounter, shellCounter);
_root[“shell”+shellCounter]._visible = true;
checkShell = “progress”;
}
}
}
[/AS]

What am I doing wrong? I start it, it shoots one bulet automatically and then doesn’t let me shoot again at all. As well I’m not sure I understand exactly what you mean with your duplicateMovie Clip post. How do I incorporate that into the script then??? Thanks a lot for your help so far :)!

I dont know how your mc’s are set up timeline wise but I would first put a _root. at the beginning of all the ‘checkShell’ variables

i.e.

_root.checkShell = “progress”;

this just ensures that the variable is checking the root level

Try that and let me know.

~ Seretha :love:

Nope…This is my current code I did what you said.

[AS]
onClipEvent (enterFrame) {
this._x += shellMoveSpeed;
if (this._x>550) {
this.removeMovieClip();
_root.checkShell = “done”;
}
}
[/AS]

and

[AS]
onClipEvent (enterFrame) {
if (_root.checkShell == “done”) {
if (Key.isDown(Key.CONTROL)) {
shellCounter++;
_root.shell.duplicateMovieClip(“shell”+shellCounter, shellCounter);
_root[“shell”+shellCounter]._visible = true;
_root.checkShell = “progress”;
}
}
}
[/AS]

I dunno…Any other ideas what I may be doing wrong? :confused:

hello…? Help! Anyone! This is driving me nuts!!!