Help with scripting windows with a close button

hello world, I would like to make a request of sorts. I would like to create a window with a little x button in the corner to close said window. If anyone could create a rough script with this it would help me a lot. As I would be able to extract other info from the script. Thanks for the assistance. Also help me out and get a 50% preorder discount on my next published game. 🙂
I don't need a discount on the game. What you could do is use show picture, then move an invisible event under where the X is that erases the picture. No script needed

Edit: If you want menu options, you could also use invisible events for those too where the options would be
This query has been solved, please close this thread.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-scripting-windows-with-a-close-button.114154/