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 to make it so you can't sell a specific item

Hey, just got a simple question here.

Okay, in my game, there is a part where the main character has to buy three apples for his Mom. You have to go to the shop and buy three apples. Is there any way to make it so that when you buy the apples, you can't sell them back? I know that you can make an item's price $0, but you still have to buy the apple.

Thanks in advance.
 

Muse

Member

Sorry, this is probably a lame solution because I just thought of it on the fly and without testing it (It's late~~), but is it possible for you to maybe have the apple-buying as an event--which gives you three apples and takes away x amount of money--rather than as an actual store? Then you could have the price set as $0 and prevent them from being sold back.

Hope that helps! XD

EDIT: Thought of another method this morning. If you really, really, really want an actual NPC shop, what you could do is have your character buy the apples normally. What you do is have two different apple items, one with the price and one with $0. Then, have a common event that says if 3 apples (the priced ones) are in inventory, then add 3 unpriced apples and remove 3 priced apples. I can see a zillion ways that way could go wrong, but it's an idea. ^_^'
 

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