# Random load function

**URL:** https://forum.kirupa.com/t/random-load-function/35881
**Category:** Uncategorized
**Created:** [November 19, 2003, 5:30am UTC](https://forum.kirupa.com/t/random-load-function/35881 "2003-11-19T05:30:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![outro\_lugar](https://avatars.discourse-cdn.com/v4/letter/o/35a633/32.png) [@outro\_lugar](https://forum.kirupa.com/u/outro_lugar)
#### Post date: [November 19, 2003, 5:30am UTC](https://forum.kirupa.com/t/random-load-function/35881/1 "2003-11-19T05:30:34Z")

</div>

I am trying to have my main file pick a random image from a bunch of files I have everytime it loads. I know that I’m supposed to have an array that holds the image file names and a function that samples the file names from that array but I cannot figure out the correct way to write the function. what do i have to do?
