Using a slider to change ImageLabel

I want to know how I would be able to change to different image label boxes based on using a sliding bar. I already scripted it, and the sliding bar works, but how would I go on changing the image label boxes

If you refer to having a set of images and then sliding with them what you can do is divide the scroller size with the number of images. Then you can get what index like this:

local images = {};

local each = maxX/#images
local imageIndex = math.round(currentX/each)

Where:

  • imageIndex refers to an index in the “images” array that is a set of images.
  • maxX refers to the full scroller size
  • currentX refers to the current scroller position