Discuss Scratch

Firerie
Scratcher
16 posts

How to make a shop

Can anyone teach me how to make a shop? I see a lot of games with them and really want to know how to create one. here is my project: https://scratch.mit.edu/projects/401474815/editor/ If anyone has any idea on how to make one please let me know
WildTraces
Scratcher
100+ posts

How to make a shop

What would you buy?
Firerie
Scratcher
16 posts

How to make a shop

skins
WildTraces
Scratcher
100+ posts

How to make a shop

You need a currency system, after that make a shop button that sets the ‘shopOpen?’ variable to 1 and a close button that sets it to 0 and maybe a box behind the icons so you can see them better and it looks more professional. Use this script in each skin sprite:

whenclickedgotox:whereevery:whereeverforeverifshopOpen?=1thenshowiftouchingmouse pointer?thensetghosteffectto20ifmousedown?thenifskinscontainsskin name?thensetcurrent skintoskin nameelseifnotmoney<cost of skinthenchangemoneyby0-costofskinaddskin nametoskinssetcurrent skintoskin namewaituntilnotmousedown?elsesetghosteffectto0elsehide

Then use this in the player sprite:

whenclickedsetcurrent skintodefaultforeverswitchcostumeto(current skin)
Firerie
Scratcher
16 posts

How to make a shop

Thanks!!
Firerie
Scratcher
16 posts

How to make a shop

wait where is the add skin name to skins and the skins contains skin name block?
RainbowsToybox
Scratcher
100+ posts

How to make a shop

So first make a variable for money, make a place to earn money. Make separate sprites that will be what you are buying (only make them visible when in the shop)
Here's the code for buying something:

whenthisspriteclickedchange Moneyby
The money you change by depends on the price. If the item is 40 money things, put -40. (This removes 40 from the player's balance)

Put this on the sprite of the item the player buys.

I hope this helped you, I'm not very good at coding. I used this store system for one of my games, so I thought I'd help.

Last edited by RainbowsToybox (June 4, 2020 11:30:13)

WildTraces
Scratcher
100+ posts

How to make a shop

Firerie wrote:

wait where is the add skin name to skins and the skins contains skin name block?

You need to press ‘make a list’ and call it skins
RobotFishy
Scratcher
1 post

How to make a shop

Um hi can anyone show me how to make a shop for guns?
Lasting_Fall
Scratcher
5 posts

How to make a shop

I need help making it so where you can buy something but you cant have under 30 bits (Cash) can anyone help?

Last edited by Lasting_Fall (Sept. 30, 2022 15:29:31)

Powered by DjangoBB