well i want it so that when the players health is equal to 80 one of the nodes which is a heart will be disabled.
The function removehearts isnt being called
That’s part of the reason why you should take your time and explain your problem in detail.
“I don’t think the function is being called because my print isn’t showing” should have been part of your original question.
Then I could’ve immediately told you that that isn’t necessarily the case. Your print comes after the conditional in your function. So the function may well be called.
What other reason might there be for the print not showing?
This finds a node in your GUI scene with the ID “heart0” and returns it as a NodeProxy:
gui.get_node("heart0")
We then pass that to gui.set_enabled(), which takes a NodeProxy and a boolean as its arguments:
gui.set_enabled(gui.get_node("heart0"), false)
Giving it false will disable the node, and giving it true will enable the node.
You can also store the NodeProxy as a variable, which is helpful if you need to perform multiple operations on a node (like moving it, changing the color, playing an animation, etc.) or just to make the code clearer:
local my_node = gui.get_node("heart0")
gui.set_enabled(my_node, false)