I'm confused on exactly what you are looking to do, but yeah, you can use conditions to make the code change based on the output provided via the randint()
function. In GDScript, you will need to use the randi
function though. The documentation shows a bit about how to use this function to generate numbers within a range.
Then you can use a conditional to change functionality based on the output. For example:
int num = randi() % 20 + 1 # returns number between 1 and 20
if (num > 0 and num < 5):
print ("Somewhere between zero and five!")
elif (num > 5 and num < 10):
print ("Somewhere between five and ten!")
elif (num == 6):
print ("Its the number six!")
else:
print ("Something more than six!")