i need to know something.
if you examine the bed, you go there and finds what is under the bed, you got the key.
if you check again, nothing.
but what do you all think it dose?
Are you asking how to make it so that the key item in your game can only be found once?
i know how inventory item works and how to use them. what i don't know was how to make hotspot react? after click on it once.
Ah, gotcha...I have no time to explain right now. Can somebody field this one. Cheers!
Try this:
function hBed_Interact() {
// walk over, look at it, etc
if (Game.DoOnceOnly("find key under bed")) {
Display("You search under the bed and find a key.");
player.AddInventory(iKey);
}
else {
Display("There's nothing else to be found.");
}
}
The text you use for "find key under bed" doesn't really matter, as long as you don't reuse it in another Game.DoOnceOnly() command elsewhere.
The text you use for "find key under bed" doesn't really matter, as long as you don't reuse it in another Game.DoOnceOnly() command elsewhere.
[/quote]
The power of if-else (and soon switch) statements can't be underestimated. These can help you keep your game persistent, dynamic, and even help you avoid crashes.
Edited by mod: Removed unnecessary quote.