How do you make a randomized guessing game?

So I want to make a guessing game (kinda like a lottery, but you don’t pay). I’ve seen a thread in the Code Review category about making a guessing game:

The problem is: I don’t know how to make players get to actually guess the randomized number.

First of all, don’t use that script. The reason it’s in #development-support:code-review is that it’s not perfect; it needs to be reviewed before being used and people have pointed out a lot of issues with it on that thread.

For your main question, there isn’t just one way. You can use UserInputService to check when a user types a number. You can also use a TextBox where they type in a number and the script checks based on that. Some people even make a system where you jump on parts in-game labelled with the numbers and use Touched to tell which number they’re “typing.” Instead of jumping on them like the previous method, you could have people click parts with numbers on them and use a ClickDetector.

There’s so many ways to handle this that it’s up to you how you want to do it. Your question isn’t really specific so it’s hard to tell exactly which one you’re looking for.

2 Likes