Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

What is wrong with this script?

Asked by 10 years ago

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?

01local bin = script.Parent
02local decal = bin.Decal
03--The numbers(5.5) are how long to wait for each slide.
04local MainSlides = {
11}
12 
13function runTable(tab)
14    for i,v in pairs(tab) do
15        decal.Texture = i
View all 22 lines...

1 answer

Log in to vote
0
Answered by
bobder2 135
10 years ago

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

0
Thanks bro. :D User#5689 -1 — 10y
0
Okay, I tested it out, but it is like froze. It only shows the decal of it. User#5689 -1 — 10y
Ad

Answer this question