var icon2 = preload("res://10.png")`
var icon3 = preload("res://19.png")
var icon4 = preload("res://28.png")
var icon5 = preload("res://37.png")
var counter = 0
fun _ready():
pass
func onButton3_pressed():
if counter >= 5: #max. picture number
counter += 1
else:
counter = 2 # first picture number
$TextureButton.texture_normal = icon+str(counter) #counter as a string
variable
Maybe you’ll need also .texture_pressed and .texture_hover.
If you want this random you should use randi_range(FROM, TO) instead of counter.