Message Help

Here >
I want to make it so the first time and only the first time you touch a box, a message pops on screen. The way I set it up, you would still get the message if you died or went to the next level. Please help!

In order to maintain the state of the box (touched or not touched yet) across levels, you’ll have to store that info somewhere. If you only ever want the message to display once (even if the game is played multiple times), then you’ll need to store the information using a “Save” block. You could for example store the number “1” in a Save block, and then check for that value before showing the Alert.

If you want it to show up every time the game is played, but only once, then you could store the value in a global object instead. Create an object that is set to “Do not reset”, then use that object to display your Alert window. When your player touches a box, send a message to the global object instead of displaying the alert from the player or box objects.

@grazer how do I make set it to “Do not reset”? I can’t find it in the object’s properties. I see “Keep on level restart,” and “Keep between levels” but no “Do not reset.”

Sorry, I meant “Keep between levels”. This way it is never reset.

@grazer The message doesn’t pop up again when going to the next level, but it reappears if you die then touch the box on the same level. Any way to fix this?
Edit: It appears the block I stored the messages in duplicated… what?

I have the same problems!

I think I fixed it… but I don’t even know how.