Coin mechanism broken

So this is my code:


I have more than 49 coins:

It’s not letting me:

@TeamCreations help please?

6 Likes

What I think might be going on is issues with user variables not recognizing their value, which happens to me a lot. The way a found around this is to set the user variable to itself when the game is playing and that seems to fix it for me, however you may want to delay it how often it sets itself as I found that this can cause lag.

6 Likes

Do check once if ((COIN_USER) × 1) > 49. The times 1 forces the variable to be treated as a number instead of a string (which is what it’s stored as).

8 Likes

Yay, it worked!
Thanks so much.
Will add you in credits


@ElijahPw i haven’t tried yours yet but thanks anyway :>

7 Likes

both @/Crosbyman64 and @/ElijahPw solutions are valid, the only difference is that @/Crosbyman64’s is a temporary solution while @/ElijahPw’s is a permanent solution. If you’d like to keep the value inside Coin_Useras a string, use Cros’ solution. If you’d like to keep the value inside that variable as a number, use Eli’s solution :))

7 Likes

Although @/ElijahPw’s method does indeed convert the string to a number (given that only numeral inputs are used), it only needs to be done once via When Game starts rule. It only stores as string after Restarting/Leaving the project.

7 Likes

oh lol and yea true, i didn’t notice they use when game is playing instead of when game starts

6 Likes

This topic was automatically closed after 5 days. New replies are no longer allowed.