Hello there,
I would like to make a button that makes a RANDOM CHOICE. Ok, so I have a menu button that, when clicked goes to a certain point (label) in the game. But I would like this button, when clicked to go to a random label out of, say a set of 3 choices of labels.
How do I do this? Any help would be very much appreciated.
Thank you.
Auto.
I would like to make a button that makes a RANDOM CHOICE
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Re: I would like to make a button that makes a RANDOM CHOICE
Code: Select all
menu:
"Where to go?"
"Go home.":
"You went home."
"Go somewhere. Anywhere.":
$ randomnum = renpy.random.randint(1,3) # (randomize between 1 and 3)
if randomnum == 1:
jump library
if randomnum == 2:
jump school
if randomnum == 3:
jump restaurant
Re: I would like to make a button that makes a RANDOM CHOICE
Cool, thank you so much. I'll give it a go.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot]