I have a problem with my shop code

Godot Version

Godot 4

Question

I have a problem with my shop code. I am trying to code an option to buy a character. The rest of the code works, but theres an issue blocking it from working. On my lables code, i put:

“‘Text = “Gold: “ + str(game.gold)”’

Its supposed to be what shows the gold amount, which is 1200 (money you have when you load into game). However, when i try to test it, it pauses the game and displays the error: “_process: Invalid access to property or key ‘Gold’ on a base object of type ‘String’.”

Since im a new developer, i do not know what this means. If someone could explain and possibly tell me what to do so this doesn’t happen again?

Sounds like it believes your game is a string, which means it does not have a property .gold. How are you assigning this game variable?

yeah, it is.

Oh. Well if you intend game to be a string then you do not need to convert it to a string, but you cannot get .gold from it.

Text = "Gold: " + game