Generating a Random Number

Im creating a lottery number tracker for a game. The issue im having is trying to make the button below the input box generate a number between 01-10 and apply it to the input box above it. Ive explored several different plugins and forum post, but I want able to get it to work.

Any suggestions?

Hi there, @toddpechin12344… if I understand your post correctly, one way to do what you described is to create an option set with options of 01 through 10. Then, create six custom states, all of which have a state type of the option set. When each button is clicked, set a different custom state to a random option from the option set. Here is an example for the first button.

Finally, set each box’s value to the custom state that is being set by the button below the box, and you should get the desired result.

Hope this helps.


1 Like

Regarding the first image, How do I get the same Value options that you had generated?

If you are asking what the option set looks like, here it is.

I feel stupid, I forgot all about option sets. The only other issue Im getting is this now with the value

How is that state defined… text or number?

You may have to use :convert to number function.

What is the state type of your custom state? It needs to be linked to the option set.

1 Like

The type is text

Set it to the option set.

I did the exact same thing you provided and its still providing me red value text (my last image)

Then you’re still doing something wrong, and without being able to see every part of your setup, I don’t know what that is. For the heck of it, delete the red expression and try to create it again.

Do you mind PMing me your email and Ill add you as a collaborator?

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.