Page 1 of 1

Help me to solve this problem, please!

PostPosted: Sun Dec 23, 2007 9:29 pm
by Pietro Italy
I have a little problem in script editor, I'm making a game with diamonds to collect. When you collide with a diamond, the counting of diamonds go to 1. I've put this code on destroy actor of the diamond:

rest2.textNumber = rest2.textNumber + 1;

But the rest2 (actor who counts the diamonds), has a clone, and I'd like to put the same event to its clone, so I put:

rest2.1.textNumber = rest2.1.textNumber + 1;

But the program doesn't consider .1 as a clone of rest2. Is there another way to do what I want, because this one didn't work. Thanks for help.

Re: Help me to solve this problem, please!

PostPosted: Sun Dec 23, 2007 10:24 pm
by makslane
Use the getclone2 function:
http://game-editor.com/forum/viewtopic.php?t=711

Code: Select all
getclone2("rest2", 0)->textNumber++;
getclone2("rest2", 1)->textNumber++;