I want like some of the decals to be like 5 seconds speed and the other ones to be like 2 to 4 seconds.
bin = script.Parent decal = bin.Decal WaitTime = 5.5 -- Wait 5.5 sec. to each decal MainSlides = {"http://www.roblox.com/asset/?id=154539172", "http://www.roblox.com/asset/?id=177042272", "http://www.roblox.com/asset/?id=157119414", "http://www.roblox.com/asset/?id=175271294", "http://www.roblox.com/asset/?id=198632478"} function runTable(table, delayTime) for i=1,#table do decal.Texture = table[i] wait(delayTime) end end while true do runTable(MainSlides, WaitTime) end
I hope you understand what I am asking.
To do this you need to use a dictionary. Dictionaries are essentially tables with keys and values, and rather than indexing the table like table[2] you'd index it by the key, table['Key'].
So, lets make a dictionary with keys of the mainslide IDs, and values of the waitTime.
local bin = script.Parent local decal = bin.Decal --The numbers(5.5) are how long to wait for each slide. local MainSlides = { ["http://www.roblox.com/asset/?id=198632478"] = 5.5 ["http://www.roblox.com/asset/?id=175271294"] = 5.5, ["http://www.roblox.com/asset/?id=157119414"] = 5.5, ["http://www.roblox.com/asset/?id=177042272"] = 5.5, ["http://www.roblox.com/asset/?id=154539172"] = 5.5, } function runTable(tab) for i,v in pairs(tab) do decal.Texture = i wait(v) end end while wait() do runTable(MainSlides) end