I'm trying to currently generate a number between 8-18 in a text box, but I'm at a loss how to do it. I managed to kind of (?) do it, but the text box displays numbers inconsistently. Sometimes when I press the button, a number is generated, and sometimes when I press the button, the text is completely empty. I don't get what I'm doing wrong.
This is for generating a character DnD-style, if anyone has any tips for that sort of thing.
Develop games in your browser. Powerful, performant & highly capable.
try this: Roll.OnClicked -> Strength.Set text -> str(round(random(8,18)))
hope this helps
I wouldn't update the text box every tick, it's not necessary. Just update the text box whenever you change its value. So put the display text action in the even that randomized the Strength value (make sure it's AFTER any events/actions that modify number. It means a few more actions but IMHO it's less prone to error.