Script to randomly select ID

I have this script here ready for a list of IDs, but how can I get my image label to randomly pick an ID on the list?
image

You would have to put your ids in a dictionary (i think that is what it is called) like this.

local imageIds = {"id here","id here"}
local soundIds = {"id here","id here"}

After that you would need to use math.random to pick a random id like so.

local randomImage = imageIds[math.random(1,#imageIds)]
print(randomImage)

And that should work.(do the same thing for random sound ids)

2 Likes