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

How do you make a table? [closed]

Asked by 9 years ago

This question already has an answer here:

Tables

How do you make a table and what are they used for in scripting?

Marked as Duplicate by BlueTaslem

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?

3 answers

Log in to vote
0
Answered by 9 years ago

Tables are like variables with multiple stuff stored within them.

table = {2,true,"Hello"} -- Tables can store these within them

while true do
    print(table[2]) -- The no. in [ ] is what you want it to print in the table.
    wait(1)
end

--[[
    Printed in Output = true
--]]

for 1 , 3 in pairs do
    print(table[i])
    wait(1)
end

--[[
    Printed in Output = 2
                         = true
                         = Hello
Printed one after the other as i = 1 and v = 3 so it does it 3 times, one after the other.
--]]
Ad
Log in to vote
1
Answered by 9 years ago

Agreeing with the other answers, but you're better off with this.

http://wiki.roblox.com/index.php?title=Table

Log in to vote
0
Answered by
Relatch 550 Moderation Voter
9 years ago

Tables are used to hold things together. They usually hold values or keys. They are seperated by a comma, or a semicolon;.

a = 1 --Explains A used in the table below.
b = 2 --Explains B used in the table below.
c = 3 --Explains C used in the table below.
datable = {a, b, c} --Da Table(lol).

while true do --Just an example using a table.
    print(1, 2, 3) --Prints 1, 2, 3 used above in the table.
    wait(1) --Always wait 1 second before ending a infinite loop.
end