Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Need help with using arithmetic's on a table?

So I want to make this script that creates like 40 multiples of 3 and stores it in a table. How would I go about doing that? This is what I want to happen.

local number_Table = {3}

for i =1, 60 do
for i,v in ipairs(number_Table) do
table.insert(number_Table, + 3)	
end	
end

1 comment

0

No problem!

1 answer

✓ Accepted answer

first of all to help yourself out you should really work on indenting your code properly. Now we get on to your question. The easiest way to do what you are asking I think is to use an empty table like so:

local number_Table = {}
-- then do the for loop
for i = 1, 60 do
	table.insert(number_Table, i * 3) -- this way we can get 3 times every number up to sixty
end

1 comment

0

thank you for answering my question, i was so confused.

This discussion is preserved as it was. New answers, comments, and votes are closed.