Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Try putting this at the beginning of the script!
- function list(lv,ln,lm,lt)
- a = {}
- for i=1, #lv do
- if #a == 0 then
- table.insert(a,1,{i,lv[i]})
- else
- table.insert(a,#a,{i,lv[i]})
- end
- end
- if lm ~= nil then
- if lm == "print" then
- t = "--"..lt.."--:\n--"..ln.."--"
- for i=1, #a do
- t = t.."\n| "..a[i][1].." : "..a[i][2]
- end
- t = t.."\n--------------------------"
- print(t)
- elseif lm == "warn" then
- t = "--"..lt.."--:\n--"..ln.."--"
- for i=1, #a do
- t = t.."\n| "..a[i][1].." : "..a[i][2]
- end
- t = t.."\n--------------------------"
- warn(t)
- elseif lm == "error" then
- t = "--"..lt.."--:\n--"..ln.."--"
- for i=1, #a do
- t = t.."\n| "..a[i][1].." : "..a[i][2]
- end
- t = t.."\n--------------------------"
- error(t)
- elseif lm ~= nil and lm ~= "print" and lm ~= "warn" and lm ~= "error" then
- warn("Error in function list() -- mode '"..lm.."' isn't nil and isn't valid; use print/warn/error")
- end
- end
- return a
- end
- --Try running this in your script:
- --variables:
- --lv = any table
- --ln = name of the thing to print
- --lm = mode [print or warn or error; otherwise nil]
- --lt = a string if mode isn't nil and print or warn or error
- list({"a","b","c","lol"},"Testing 123","warn","here's something testy")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement