Godot Version
4
Question’ Ask your question here! Try to give as many details as possible`
I’m trying to have the amount of times you can click on the apple and get a point for it to be limited to 5 and then have it not do anything anymore. don’t know where to start. its all working so far, but i just need to add this.
var money = 0
var apple = 0
var bread = 0
var milk = 0
var knife = 0
var pepperspray = 0
func _process(_delta: float) -> void:
$money_label.text = "Money: " + str(money)
$Label.text = "Apples: " + str(apple)
$Label2.text = "Bread: " + str(bread)
$Label3.text = "Milk: " + str(milk)
$Label4.text = "Pocket Knife (optional): " + str(knife)
$Label5.text = "Pepper Spray (optional): " + str(pepperspray)
func _on_wallet_pressed() -> void:
money += 1
func _on_apple_pressed() -> void:
if money >= 5:
money -= 5
apple += 1