Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function tostringV2(any,ind)
- if type(any)=="string" then
- return '"'..any:gsub("\n"," ")..'"'
- elseif type(any)=="number" then
- return tostring(any)
- elseif type(any)=="table" then
- return tableToString(any,ind+1)
- elseif typeof(any)=="Instance" then
- return any:GetFullName()
- elseif typeof(any)=="function" then
- return tostring(any)
- elseif typeof(any)=="RBXScriptConnection" then --robloc lol
- return "RBXConnection"
- elseif type(any)=="boolean" then
- return tostring(any)
- elseif any==nil then
- return "nil"
- end
- end
- function tableToString(t,ind)
- local str="{\n"
- for i,v in pairs(t) do
- if type(i)=="string" then
- str=str..(" "):rep(ind or 1)..'["'..i..'"] = '..tostringV2(v,ind)..",\n"
- elseif type(i)=="number" then
- str=str..(" "):rep(ind or 1).."["..i.."] = "..tostringV2(v,ind)..",\n"
- end
- end
- str=str..(" "):rep(ind-1 or 1).."}"
- return str
- end
- print(tableToString({{{4*2,{{"g",67}}},{(10)},{"hi"}}},1))
- --[[
- {
- [1] = {
- [1] = {
- [1] = 8,
- [2] = {
- [1] = {
- [1] = "g",
- [2] = 67,
- },
- },
- },
- [2] = {
- [1] = 10,
- },
- [3] = {
- [1] = "hi",
- },
- },
- }
- ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement