This is function that I was using to test damage in my game where if an enemy enters the area of the player to take 10 damage off of their total health and update the texture pregress node called HealthBar
export var health: = 100
func sethealth(value):
if health == 0:
kill()
else:
health -= 10
getnode("HealthBar").setvalue = health
Whenever I run the code it has an error that says "invalid set index 'set_value' (on base: 'control') with value of type 'int'
Can someone please help me fix it
Thanks