I want to make a chest, when a person clicks the button, it says something about the chest but I wanted it to be random.
Put all the phrases in an array, and then select a random array entry.
For example, I’ve got an array of phrases:
And I can select a random entry with:
That expression selects a random number from 0 to (the number of phrases) - 1. We add that -1 at the end as the last array entry is #4 even though there are 5 entries in total because the array is zero indexed (first entry has an index of 0).
I DIDN’T UNDERSTAND, I WAS VERY CONFUSED
Please don’t write in all caps, it’s akin to shouting.
And what don’t you understand? Please be specific.