How to rotate through images based on time

I wanna loop through a bunch of decals, but have it based on a given time

-- Imagine actual image ids
local ImageIds = {
    1,
    1,
    1,
    1,
    1,
    1
}

for i = 1, #ImageIds do
    Decal.Texture = "rbxassetid://" .. ImageIds[i]
end

I basically want the images to cycle from the first image, to the last imagine, but I want to be able to give a time as to how long it should take to get from start to finish.

I do NOT want a time between each image.

This is my best attempt, but I don’t think it’s that efficient

local TimeLength = 4
for i = 1, #ImageIds do
    Decal.Texture = "rbxassetid://" .. ImageIds[i]
    wait((1 / #ImageIds) * TimeLength)
end
local Ids = { 1, 2 , 3 }

for index, value in next, Ids do
  Decal.Texture = value
  wait(1)
end

Please learn to read the post before answering with an answer that I specifically said I don’t want to use

:upside_down_face:

i still dont understand what is a time between each images

wait(1)

I don’t want a time between each image. I want 20 (for example) images to cycle through in a given time.

local Ids = { 1, 2 , 3 }
local Length = 4

for index, value in next, Ids do
  Decal.Texture = value
  wait(Length / #Ids)
end

Doesn’t really make a difference, but why not use

for i, v in pairs(Ids)

or even

for i, v in Ids

idk, because the results are the same

yeah i guess so…

(TEXT-TEXT)

Hello NinjoOnline!

I believe I have created the solution you were looking for! Please refer to my code below.

local imageids = {
	1,
	2,
	3,
	4,
	5,
	6,
	7,
	8,
	9,
	0
}
local cycletime = 5
local decal = Instance.new("Decal")
--
for i,v in pairs(imageids) do
	decal.Texture = "rbxassetid://" .. v
	wait(cycletime / #imageids)
end