I am trying to set up a script for the setters and getters of my Characters Gold however i am having a bit of trouble and im not sure what im doing wrong, this script is supposed to allow me to Get how much gold the character currently has and also set it where appropriate but its not working at all it gets stuck at my set_thiefcoins function at the get node part.
Any help would be highly appreciated :)
var warrior_coins setget set_warcoins, get_warcoins
var mage_coins setget set_magcoins, get_magcoins
var thief_coins setget set_thiefcoins, get_thiefcoins
var king_coins setget set_kingcoins, get_kingcoins
func set_warcoins(value):
warrior_coins = value
get_node("warrior_coins")
func get_warcoins():
return warrior_coins
func set_magcoins(value):
mage_coins = value
get_node("mage_coins")
func get_magcoins():
return mage_coins
func set_thiefcoins(value):
thief_coins = value
get_node("thief_coins")
func get_thiefcoins():
return thief_coins
func set_kingcoins(value):
king_coins = 200
get_node("king_coins").set_text("Treasury: "+str(king_coins))
func get_kingcoins():
return king_coins