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

Printing all values in an array?

Asked by 6 years ago

I don't want to explain but it is pretty self-explanitory:

local lazyarray = {"im so lazy", "i dont want to type this whole thing"}

for i,v in pairs(lazyarray) do
    if v then
        print(v)
    end
end

all this does is just print 1 at a time... I need it to show all values at once in one line.

What Output says

--im so lazy
--i dont want to type this whole thing

What I want output to say

--im so lazy, i dont want to type this whole thing

hulp?

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago
local lazyarray = {"im so lazy,", "i dont want to type this whole thing"}

print(table.contact(lazyarray, ' '))

more here - https://wiki.roblox.com/index.php?title=Global_namespace/Table_manipulation
0
Oh wow I didnt know that MusicalDisplay 173 — 6y
Ad

Answer this question