Scripting help

Started by Rd27, Fri 22/10/2004 23:23:05

Previous topic - Next topic

Rd27

I have this script:

// script for object5: Interact object
if (GetGlobalInt(5)==1){
MoveObject(5,180,170,10);
}
else
MoveCharacterBlocking(EGO,132,181,1);
MoveObject(5,160,190,10);
SetGlobalInt(5,1);

I want to continue this so, that when player next time interacts the object, the player character will say, nah, it's not worth it.. But how can I do that?
How many times can I continue, so that the object moves different place always when it is interacted?

What I have done so far, has this little annoying problem:

When the object has moved second time and player interacts it after that, the object moves back to where it moved first time. And if it is interacted again, it moves back where it was and this can be done million times ;). How can I prevent that?

Thanks for help and hope that you understanded my question.

Goot

if(GetGlobalInt(5)==0){
script for first time
SetGlobalInt(5,1);
}
else if(GetGlobalInt(5)==1){
script for second time
SetGlobalInt(5,2);
}
else{
Display ("Nah, it's not worth it.");
}

Rd27

Thanks, it worked perfectly!

SMF spam blocked by CleanTalk