i have a script that i started as a bunch of if and elifs to compare the random integer to then put a specific corresponding animated sprite frame up on the screen. I modified it to use a mondo (%) and sort by integer and got rid of all the if and elif. it works perfectly except about every 5 or 6 clicks of the button it does not generate the random number. then i click again and it works fine. i added a print output to trace the issue but when it fails nothing prints in the output box either. so it looks like it fails to do the randomize and generate the rnd variable. i even changed the range from 1 to 100 to be 0 to 99 and i still got the occasional failure. Script below.
extends Node2D
#preload asa resource the dice animations
@onready var reddice: AnimatedSprite2D = $reddice
@onready var bluedice: AnimatedSprite2D = $bluedice
#set up the dice variables integer as a zero
var die1: = 0
var die2: = 0
func _on_button_pressed():
$reddice.play("reddice")
$bluedice.play("bluedice")
await reddice.animation_finished
await bluedice.animation_finished
randomize()
var rng: = randi_range(1, 100)
print(rng)
var tens: = (rng/10)%10
var ones: = (rng)%10
$reddice.frame = tens
$bluedice.frame = ones