How to make in a clicker game if you buy something it lowers your score and gives you something

Like in cookie clicker you could buy something that makes another clicker for you

Use messages and expressions

dont know what you meancould you explain that better

Messages are like wires between objects. You use messages to send a signal to an object, and a mailbox that triggers when said signal is received.

Expressions are trickier to learn, but once you learn basic algebra its childs play… In your case you will need two. One to add points (from clicking) and one to take away points. Along with a filter to check if you have enough points so you dont end up buying things you cant afford- and end up in the negatives.

Judging on your current situation, you may want to consider the use of save behaviors. You can have the game hold the amount of cookies you have, along with what you have bought or not, between sessions- I cannot stress you how helpful you will find this behavior. You can even have multiple saves pull up numbers saved by other ones.

If you need any additional info on what each behavior I have described does, each behavior has a whats this button opens a page to give you info on that behavior (it opens a new tab, and doesnt close the editor. However, if you still need help, feel free to tag me.

Starblast 2

Here is SB2, an old game of mine. It contains a good example of a shop. Feel free to copy/import behaviors if you have to, but you might learn more if you replicate it without that.

It checks the amount of currency you pick up while playing, and if you have enough, you can buy stuff, and it will take the cost away from what you have.

(Warning, because of the insane ammount of objects used, you may experience lag. Because of this, I recommend replacing play in the URL with embed. note that when playing you wont be able to open the editor, so be sure to swap between the two if you need to.)