Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How To Make A Clicker Game Shop: Upgrade Buy Limit
- ValdezFirewolf15
-
7 posts
How To Make A Clicker Game Shop: Upgrade Buy Limit
So in my clicker game, you can buy any upgrade infinitely with enough points. I'm trying to figure out how to make it so that you can only get it once.
Code (number values vary):
Code (number values vary):
Last edited by ValdezFirewolf15 (Sept. 22, 2021 15:48:36)
- --Dovahkiin--
-
100+ posts
How To Make A Clicker Game Shop: Upgrade Buy Limit
So that wouldn't work because the script will turn off already without the “stop this script” block, and will reactivate when the sprite is clicked. Depending on how many upgrades you have, I would label them with numbers and create a list to see if its already been bought.
Now you can have this on all your upgrades and you don't need a ton of variables
Now you can have this on all your upgrades and you don't need a ton of variables
Last edited by --Dovahkiin-- (Sept. 22, 2021 16:28:36)
- LG125
-
500+ posts
How To Make A Clicker Game Shop: Upgrade Buy Limit
simple:
Here’s a better version and why: (common mistake i see)
Revised version:
Last edited by LG125 (Sept. 22, 2021 22:44:28)
- --Dovahkiin--
-
100+ posts
How To Make A Clicker Game Shop: Upgrade Buy Limit
This isn't what he wanted. He wanted a upgrade that could only be bought once
“I'm trying to figure out how to make it so that you can only get it once”
You making it possible for it to be bought more than once
“I'm trying to figure out how to make it so that you can only get it once”
You making it possible for it to be bought more than once
- LG125
-
500+ posts
How To Make A Clicker Game Shop: Upgrade Buy Limit
Oh. This isn't what he wanted. He wanted a upgrade that could only be bought once
“I'm trying to figure out how to make it so that you can only get it once”
You making it possible for it to be bought more than once
Then a list wouldn’t be necessary, only a variable. When the flag is clicked, set it to 0 (unless you wont reset everyone’s progress when flag clicked) and when item bought, set variable to 1.
- cs3432909
-
75 posts
How To Make A Clicker Game Shop: Upgrade Buy Limit
This isn't what he wanted. He wanted a upgrade that could only be bought once
“I'm trying to figure out how to make it so that you can only get it once”
You making it possible for it to be bought more than once
This script should make it possible for it to only be bought once
Last edited by cs3432909 (Sept. 23, 2021 13:17:47)
- --Dovahkiin--
-
100+ posts
How To Make A Clicker Game Shop: Upgrade Buy Limit
The thing is, depending on how many upgrades there are, a list would hold all of them in one spot while on the other hand if you used variables you would need like 10 for 10 upgrades which could get chaoticOh. This isn't what he wanted. He wanted a upgrade that could only be bought once
“I'm trying to figure out how to make it so that you can only get it once”
You making it possible for it to be bought more than once
Then a list wouldn’t be necessary, only a variable. When the flag is clicked, set it to 0 (unless you wont reset everyone’s progress when flag clicked) and when item bought, set variable to 1.
- ValdezFirewolf15
-
7 posts
How To Make A Clicker Game Shop: Upgrade Buy Limit
Thank you so much! So that wouldn't work because the script will turn off already without the “stop this script” block, and will reactivate when the sprite is clicked. Depending on how many upgrades you have, I would label them with numbers and create a list to see if its already been bought.
Now you can have this on all your upgrades and you don't need a ton of variables
- Discussion Forums
- » Help with Scripts
-
» How To Make A Clicker Game Shop: Upgrade Buy Limit