I've made a script that is practically the game intro/ loading screen and I want it to randomly select a photo from a library I give it within the same script and put it as the image of the photo, idk how to tho
✓ ANSWER ACCEPTED
HOW TO CHOOSE A RANDOM IMAGE?
1 answer
✓ Accepted answer
local images = {} --put image ids here, separated by a comma like {"1234", "5678",}
local chosen_image = images[math.random(#images)] --Picks a random entry in the images table
chosen_image = "rbxassetid://".. chosen_image --Turns the ID into a url for use
Hope I helped :)
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Yeah it's a massive help, now I can just add a line like script.Parent.image = chosen_image to make it change the photo?
Yea
seems like I ran into trouble with that since it didn't change the actual photo it doesnt do anything