how do i make a slideshow of different decals (kinda like on a block u see a picture and every few minutes it changes
To get started, you need to get in touch with some aspects of the API.
while [condition] do --code end
The while
loop iterates upon checking a condition. If the given condition is false, the loops ends. Alternatively, if the condition is true the code will continue. But be careful, it is an infinite loop so if you have no yield inside it it can crash your studio.
local Table = {"decal1","decal2","decal3"}
A table is a data type in Lua that is useful to store multiple values. Their contents can be checked by either indexing the table, using the table's name and the desired index: val1 = Table[1]
, or by iteration through the pairs
, next
or ipairs
function in a generic for loop.
Create a table full of all of the decal ID's you wish to go through. Then, make a while loop to constantly cycle through the ID's and set the decal.
local decal = workspace.SomeBlock.Decal --This is your decal! local ids = {"6472847","9184539","1284632","1847543"} --These are your ids local interval = 1 --This is the time, in seconds, between transitions while true do --Start the while loop for _,v in next, ids do --Iterate through your table decal.Texture = "rbxassetid://"..tostring(v) --Set the texture wait(interval) end end
Closed as Not Constructive by SimplyRekt, InfinitivePixelsJr, and BlueTaslem
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?