Random Image (Code)

Hello

I apologize for my broken English, I come from Poland.

Is there anyone who can help me? If so, thank you in advance.

I need a code for random images (Slides)

More specifically, I mean, when I cut the image from right to left (Touch.x), it showed a random image from ‘myImages’

Once again, I apologize for my English

Greetings

Hi @dawidlipinski86,

Try shuffle myImages table 

-- Somewhere near the start of your program math.randomseed( os.time() )  local function shuffle( tbl )     local rand = math.random     local j     for i = #tbl, 2, -1 do          j = rand( i )          tbl[i], tbl[j] = tbl[j], tbl[i]          end      return tbl  end

I’m also from Poland:) You can send me pm I will try help you.

Have a nice day:)

ldurniat

Hi @dawidlipinski86,

Try shuffle myImages table 

-- Somewhere near the start of your program math.randomseed( os.time() )  local function shuffle( tbl )     local rand = math.random     local j     for i = #tbl, 2, -1 do          j = rand( i )          tbl[i], tbl[j] = tbl[j], tbl[i]          end      return tbl  end

I’m also from Poland:) You can send me pm I will try help you.

Have a nice day:)

ldurniat