Godot Version
4.72
Question
Does anyone know what I have to change so it updates every time its suppose instead of me clicking I cant find any solutions for this.
extends Button
var price_of_clicker = 100
var clicker = 1
var amount_of_clicker = 0
signal Amount_of_clicker_changed
func _pressed():
if Global.Cookie >= price_of_clicker:
Global.Cookie -= price_of_clicker
price_of_clicker *= 1.5
amount_of_clicker += 1
emit_signal("Amount_of_clicker_changed", amount_of_clicker)
else:
print("You dont have enough money to buy a clicker")
return
func _on_amount_of_clicker_changed(amount) -> void:
if amount >= 1:
print("Success")
while true:
await get_tree().create_timer(1).timeout
print("hello")
Global.Cookie += amount * clicker
extends Button
signal Clicked
func _pressed() -> void:
Global.Cookie += Global.Cookiesonclick
emit_signal('Clicked', Global.Cookie)
#this is for my text label unreleated to the other script#