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
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