Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Evilcobra2213 |
I am trying to make multiple death messages and I want them to be chosen at random, how can I do that?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Evilcobra2213 |
I am trying to make multiple death messages and I want them to be chosen at random, how can I do that?
Reply From: | jgodfrey |
Something like this should get you started
func _ready():
var death_messages = [
"message 1",
"message 2",
"message 3"
]
randomize()
var msg = death_messages[randi() % death_messages.size()]