Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

How do i make this kind of script?

How do i make this kind of script?

When item_id is pushed/being used, (but where in the database the item_id is not consumable so that it doesnt disappear.) then, Show_Choices. If show_choices show choices of Yes or No, when yes then do whatever and remove the item from inventory, when no, then keep in inventory
 
You don't need a script for this, all you need is a common event and your item.
First make a Common Event (I'd name it the same thing as your item, for simplicities sake). Have that commen event set to have no trigger.
Now go to your items and make your item not consumable. Name it, give it a price, description, everything but telling it what to do. Instead, tell it to call a commen event; the same commen event you just made.
This will make it so when the player uses the item, they are prompted the question you entered and only when they reply yes, will they lose the item.

Hope that makes sense and helps. If anything is confusing, feel free to ask.
 
So you want a certain event to play out if they buy a certain item. Well, if there's no other way to get the item, then add a conditional branch after the shop processing that checks if the item is in their inventory. Turn off else branch, since you won't need that. Anyway, inside the branch put the events that you want. Flick a self switch and all that jazz if you don't want it to happen everytime they buy it. Hope that makes sense, and hope that that was what you were asking.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top