Never mind, I figured it out. I ended up declaring player_gold as a var in the main.c script, and now it is working just fine.