[code] if (Game.DoOnceOnly("arbitrary but unique string")) {
// ...
}[/code]
So don't use the string "finding tape" again, use another string instead, e.g. "finding bottle".
I just wanted to clarify this a bit. What happens is when you call Game.DoOnceOnly you specify a string value as the parameter. It can be anything you want it to be. AGS then takes that value and checks if you ever used it before. If you have, then the function returns
false; otherwise it returns
true.
So, technically speaking, the following is completely valid:
[code]if (Game.DoOnceOnly("some repeated string")) {
Display("1");
}
else if (Game.DoOnceOnly("some repeated string")) {
Display("2");
}
else if (Game.DoOnceOnly("some repeated string")) {
Display("3");
}[/code]
That will compile and run fine. However, you will only ever see the message, "1" displayed. Since you're passing the same string AGS detects that you have used it before and will return false for each of the else clauses.
My reason behind pointing this out is that you might want to check whether the user has found the bottle in more than one place. Although the code will compile properly, if you are specifying the same identifier string value in more than one location in your script, the Game.DoOnceOnly function will only return true one time for every instance of that identifier.
This can be useful if properly applied, but it's important to recognize what exactly is taking place when you are using this function.