Cycling Multiple ImageLabels on a Part

Hello!

I am trying to make a digital billboard, similar to the ones in Times Square that cycle through advertisements. I have a SurfaceGui with two child ImageLabels (Sandwiches_Limited and Sandwiches_Unlimited) that contain the advertisements themselves. My coding attempts have been unsuccessful in creating a cycle. Here is the script I have right now, located in a LocalScript (child of the SurfaceGui):

while true do
	script.Parent.Sandwiches_Limited.Visible = false
	script.Parent.Sandwiches_Unilmited.Visible = true
	wait(10)
	script.Parent.Sandwiches_Limited.Visible = true
	script.Parent.Sandwiches_Unilmited.Visible = false
	wait(10)
end

If anybody knows how I could make this work, any help is appreciated! Thank you!

<3 Glory

This shoudt work

Blockquote-- Erstelle zwei Billboard GUIs
local gui1 = Instance.new(“BillboardGui”)
gui1.Name = “MyBillboardGui1”
gui1.Parent = game.Workspace
local gui2 = Instance.new(“BillboardGui”)
gui2.Name = “MyBillboardGui2”
gui2.Parent = game.Workspace
– Setze die TextLabels für die GUIs
local textLabel1 = Instance.new(“TextLabel”)
textLabel1.Text = “GUI 1”
textLabel1.Parent = gui1
local textLabel2 = Instance.new(“TextLabel”)
textLabel2.Text = “GUI 2”
textLabel2.Parent = gui2
– Zeitintervall in Sekunden, nach dem die GUIs wechseln sollen
local interval = 5
– Funktion zum Ein- und Ausblenden der GUIs
local function ToggleGUIs()
gui1.Enabled = not gui1.Enabled
gui2.Enabled = not gui2.Enabled
end
– Starte den Timer
while true do
wait(interval)
ToggleGUIs()
end

Do you want it to cycle back and forth between two images, or do you want it to cycle through an array of images?

Eventually it will be an array, but I have only made two of the images I will be using so far.

Well, i’d recommend making a table then, since you’re saying cycling i assume you mean in a specific order, for this i’d make a table and then cycle through it using a for loop inside a while loop.

local images = { -- Insert your id's in here, i added some already.
	"10874717231";
	"4906259168";
	"4675199992";
	"15162054328";
}

local image = script.Parent

while true do
	for _, v in pairs(images) do
		image.Image = "rbxassetid://"..v
		task.wait(1) -- Change to your desired wait time.
	end
end