mad1231999

Untitled

Feb 6th, 2013
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. local function readTable(t)
  2.    local s = "{"
  3.  
  4.    for k, v in pairs(t) do
  5.       if type(k) == "string" then
  6.          s = s .. tostring(k) .. " = "
  7.       end
  8.  
  9.       if type(v) == "string" then
  10.          s = s .. "\"" .. tostring(v) .. "\"" .. ", "
  11.       elseif type(v) == "number" or type(v) == "boolean" then
  12.          s = s .. tostring(v) .. ", "
  13.       elseif type(v) == "table" then
  14.          s = s .. readTable(v) .. ", "
  15.       end
  16.    end
  17.  
  18.    s = s .. "\"end\"}"
  19.    return s
  20. end
Advertisement
Add Comment
Please, Sign In to add comment