Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How can i build a shop in clicker game (like you need 400 points to buy it)?
- Polek56
-
Scratcher
3 posts
How can i build a shop in clicker game (like you need 400 points to buy it)?
I dont know how to make requierments in game
- anuntitledscratcher
-
Scratcher
28 posts
How can i build a shop in clicker game (like you need 400 points to buy it)?
Hello!
If you have a variable for clicks (or whatever currency the clicker game uses), using this script, you can check whether they have enough clicks to buy a certain item:
In the if statement, you can put the code to receive the item, and in the else statement, for example, you can make the sprite say “you don't have enough clicks”.
If you have a variable for clicks (or whatever currency the clicker game uses), using this script, you can check whether they have enough clicks to buy a certain item:
when this sprite clicked
if <(clicks) > [amount the item costs]> then
else
end
In the if statement, you can put the code to receive the item, and in the else statement, for example, you can make the sprite say “you don't have enough clicks”.
- AwesomeDuckYT
-
Scratcher
51 posts
How can i build a shop in clicker game (like you need 400 points to buy it)?
when this sprite clicked
if <(points) > [400]> then
broadcast [item bought v]
else
say [Sorry, Not enough money] for (2) secs
end
Last edited by AwesomeDuckYT (Sept. 24, 2021 21:38:48)
- Polek56
-
Scratcher
3 posts
How can i build a shop in clicker game (like you need 400 points to buy it)?
Thanks
- womit
-
Scratcher
10 posts
How can i build a shop in clicker game (like you need 400 points to buy it)?
or, you could do it like this,
this way if the player tries to use an item that they haven't bought you can use this code,
when this sprite clicked
if <<(score) = [10]> or <(score) > [10]>> then
insert [pot] at (1 v) of [bought v]
else
say [not enough money] for (1) secs
end
this way if the player tries to use an item that they haven't bought you can use this code,
when this sprite clicked
if <[bought v] contains [pot] ?> then
use item
else
say [you do not own this!] for (1) secs
define use item
delete (1) of [bought]
- ZavMario
-
Scratcher
13 posts
How can i build a shop in clicker game (like you need 400 points to buy it)?
when this sprite clicked
if <(Coins) < [399]> then
change (Coins) by (-400)
change (Clicks Speed) by (0)
end
Did I help?
Last edited by ZavMario (Sept. 25, 2021 21:59:30)
- AirfulGames
-
Scratcher
100+ posts
How can i build a shop in clicker game (like you need 400 points to buy it)?
when this sprite clicked
if <(Coins) < [399]> then
change (Coins) by (-400)
change (Clicks Speed) by (0)
end
Did I help?
its
when this sprite clicked
if <(Coins) > [399]> then
change (Coins) by (-400)
change (Clicks Speed) by (0)
end
- Discussion Forums
- » Help with Scripts
-
» How can i build a shop in clicker game (like you need 400 points to buy it)?