This can be accomplished using tables and loops (which you are already doing to an extent). Specifically while and for loops. To add another image, add another image id to the ImageIDS table. Make sure to use the same format as the current ids are.
Solution:
local ContentProvider = game:GetService("ContentProvider")
local ImageIDS = {"rbxassetid://id1", "rbxassetid://id2", "rbxassetid://id3", "rbxassetid://id4"}
ContentProvider:PreloadAsync(ImageIDS)
while wait(1) do
for _,ImageID in pairs(ImageIDS) do
script.Parent.Image = ImageID
wait(4)
end
end
Solution without ContentProvider:
local ImageIDS = {id1, id2, id3, id4}
while wait(1) do
for _,ImageID in pairs(ImageIDS) do
script.Parent.Image = "rbxassetid://" .. ImageID
wait(4)
end
end
The while loop waits 1 second before running. It will wait until the for loop is done before starting again. The for loop goes through your list of images and sets the image. It then waits 4 seconds before continuing.
In the first solution I am using the "ContentProvider" service to preload images. This means that you will have to fill your table with images instead of ids. In the second solution this isn't necessary, but your images may not load.
To get an image from an id you can (in Roblox Studio):
Create a decal.
Put your id in the "Texture" section of the decal.
Hit enter
The id should be replaced with an image id.
This is the best method afaik for getting images. Someone can correct me on that.
1 comment