I asked this question before, and it worked :D. But when I tried it out, it went like out of order. Instead of starting from the first to the last, it did it backward. What is wrong with it?
01 | local bin = script.Parent |
02 | local decal = bin.Decal |
03 | --The numbers(5.5) are how long to wait for each slide. |
04 | local MainSlides = { |
05 | [ "http://www.roblox.com/asset/?id=213163470" ] = 15 , |
06 | [ "http://www.roblox.com/asset/?id=213486920" ] = 3 , |
07 | [ "http://www.roblox.com/asset/?id=157656296" ] = 3 , |
08 | [ "http://www.roblox.com/asset/?id=213486967" ] = 3 , |
09 | [ "http://www.roblox.com/asset/?id=151111211" ] = 3 , |
11 | } |
12 |
13 | function runTable(tab) |
14 | for i,v in pairs (tab) do |
15 | decal.Texture = i |
Line 14 says for i,v in pairs(tab) do
This will iterate through the table in some weird order. Instead use ipairs
which means iterated pairs. This will go through the table in order.
for i,v in ipairs(tab) do