-- Table uneval by MikuAuahDark

-- Create function
function table.uneval(t,l)
	-- Create string that represent table
	local str="{\r\n"
	-- the "l" variable, it's for tabulation.
	l=l or 1
	-- Do loop at table
	for n,v in pairs(t) do
		-- Check if it's not looped table
		if v==t then error("infinite-loop table detected!") end
		-- if it find a "space" on key
		if tostring(n):find("%s") then
			-- use ["string with space"]=value system
			str=str..string.rep("\t",l).."[\""..n.."\"]="
		-- if key is number
		elseif tonumber(n) then
			-- use [number_here]=value system
			str=str..string.rep("\t",l).."["..n.."]="
		-- if key is string and no "space" found
		else
			-- use string_without_space=value system
			str=str..string.rep("\t",l)..n.."="
		end
		-- Check if it's table. If it is then it execute this function again with another table
		if type(v)=="table" then str=str..table.uneval(v,l+1)..",\r\n"
		-- Check if it's string. If it is then add a " and " on start and end of string
		elseif type(v)=="string" then str=str.."\""..v:gsub("\"","\\\"").."\",\r\n"
		-- Check if it's boolean
		elseif type(v)=="boolean" then str=str..tostring(v)..",\r\n"
		-- No type found. use tostring instead.
		else str=str..tostring(v)..",\r\n" end
	end
	-- Return string
	return str..string.rep("\t",l-1).."}"
end