I made a gif script, but I am like getting tired of copying http://www.roblox.com/asset/?id=[ID] to make 23 pics into gifs. Is there a way to just put the id number in there to make it easier for me to paste the id only. This is the script I have been using before with the dancing banana GIf:
while true do script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=152333727" wait(0.1) script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=152333747" wait(0.1) script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=152333792" wait(0.1) script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=152333817" wait(0.1) script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=152333831" wait(0.1) script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=152333855" wait(0.1) script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=152333875" wait(0.1) script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=152333892" wait(0.1) end
I need an easier way where it will be like this: 152333727, 152333747, etc.
Yes, there is.
There are dandy things called Tables
.
Tables are used to store multiple information, with one variable.
To use tables, you only need to do variableName = {}
For example
local table = {"Potato","Apple"}
Now, we have a table with the strings Potato and Apple.
What if we want to access this table? You use these brackets [ ]
Let's see, there are 2 strings in the table, the second one is Apple, I want to access that, so how do I do it?
Like this
print(table[2])--since Apple is the second string in the table, we use 2 to refer to it.
So how does this apply to your question?
You can store decal ids in a table.
local decalsIds = {1232131038912,000101010101,1337360} function pickdecal(num) local decal = Instance.new("decal",game.Workspace.BasePlate) decal.Texture = "rbxassetid://"..soundIds[num] wait() decal:Destroy() end while true do for i,v in pairs(decalsIds) do wait() pickdecal(i) end end
for i = 1, 23 do script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=152333892" wait() end script:Destroy()
It will do that function 23 times then it stops
Add the ID's in the table,
assets = {1324123,3525323,67686454} while true do repeat tst = 1 script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=" .. assets[tst] tst = tst + 1 wait(.1) until tst == #assets end
It should work.