[SOLVED] Trying to call boolean value from one script in another

I’ve followed other forum examples to perform similar tasks in my code, but for some reason it seems to refuse to follow suit when I attempt to access a boolean variable. I get access to the script by making the entity it is attached to an attribute of the other script: Buttons.attributes.add(‘manager’, {type: ‘entity’});, then try to access the boolean: this.bet = this.manager.script.gameManager.removedCoins;, and use it later when I need it: if(this.bet === true), but no matter how I try the value always comes back undefined.

Here is link to full code.
https://playcanvas.com/editor/code/529780?tabs=10829078,10800992,10830385,10859876,10827801,10799779,10799160

In your GameManager script you do not define removedCoins as a property of the GameManager. Instead you are just defining a variable called removedCoins outside the scope of the GameManager. Try doing this.removedCoins = false inside the initialize method of the GameManager instead.

That fixed it, always the small things that cause the biggest problem.