Hello.
I will make a dice-chucking-app. It should be support 4, 6 and 20-sided dices.
With 3 buttons (w4, w6 and w20button) you can choose which type the dice should be (wergebnis as variable). The buttons change the value of wergebnis to a random number set in the range of the dice type (example: 4 sided to 1-4).
at the beginning in the ready-function i declare a random number for wergebnis, that it causes no errors when i hit the roll-button. when i hit the roll-button its always the same number, the buttons for the other dice-types (and other ranges for wergebnis) doesnt change.
i assign the code and a picture of the form. hope you can help me.

extends Node2D
func _ready():
get_node("MenueButton").connect("pressed", self, "_on_MenueButton_pressed")
get_node("RollButton").connect("pressed", self, "_on_RollButton_pressed")
get_node("W4Button").connect("pressed", self, "_on_W4Button_pressed")
get_node("W6Button").connect("pressed", self, "_on_W6Button_pressed")
get_node("W20Button").connect("pressed", self, "_on_W20Button_pressed")
var wergebnis = int(rand_range(200,600))
func _on_W4Button_pressed():
var wergebnis = int(rand_range(1,4))
get_node("W6Button").set_pressed(false)
get_node("W20Button").set_pressed(false)
func _on_W6Button_pressed():
var wergebnis = int(rand_range(1,6))
get_node("W4Button").set_pressed(false)
get_node("W20Button").set_pressed(false)
func _on_W20Button_pressed():
var wergebnis = int(rand_range(1,20))
get_node("W4Button").set_pressed(false)
get_node("W6Button").set_pressed(false)
func _on_RollButton_pressed():
get_node("WELabel").text = str(wergebnis)