Discuss Scratch

colorjuice
Scratcher
100+ posts

The store in my game is making calculations wrong. Please help.

I'm making a game about a dinosaur who tries to get a cookie, (The payment is 5 sticks and 2 pebbles) but when i try to buy the cookie, it says i don't have enough money.

I think it's this block that's going wrong.
<<(foo) > [4]> and <(☁ score) > [1]>>

(Note: foo = sticks and score = pebbles)

what I if told you…
You read first the one wrong.
And that one ^
Goodbye Human
Unless
You aren’t a human?
awesome-llama
Scratcher
1000+ posts

The store in my game is making calculations wrong. Please help.

<<(sticks) > [4]> and <(pebbles) > [1]>>

By itself, that variable check should work. I think it's something else causing it. You'll have to show more scripts, or preferrably, the entire project (by posting the URL).


WeirdBoi_test
Scratcher
10 posts

The store in my game is making calculations wrong. Please help.

More information, please! That block isn't going wrong
colorjuice
Scratcher
100+ posts

The store in my game is making calculations wrong. Please help.

Ok i shared the project so we can fix it https://scratch.mit.edu/projects/564520500/

Its not finished yet.

Last edited by colorjuice (Aug. 28, 2021 17:36:06)


what I if told you…
You read first the one wrong.
And that one ^
Goodbye Human
Unless
You aren’t a human?
awesome-llama
Scratcher
1000+ posts

The store in my game is making calculations wrong. Please help.

I see the mistake. You are checking for 5 pebbles and 2 sticks, not 5 sticks and 2 pebbles. Swap the variables around.


colorjuice
Scratcher
100+ posts

The store in my game is making calculations wrong. Please help.

awesome-llama wrote:

I see the mistake. You are checking for 5 pebbles and 2 sticks, not 5 sticks and 2 pebbles. Swap the variables around.
It worked! Thanks!

what I if told you…
You read first the one wrong.
And that one ^
Goodbye Human
Unless
You aren’t a human?

Powered by DjangoBB