Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetType(item)
- if type(item) == "string" then
- return "\""..item.."\""
- elseif type(item) == "table" then
- local str = "{"
- local max = 0
- local numb = 1
- for i,v in pairs(item) do
- max = max+1
- end
- for i,v in pairs(item) do
- if numb == max then
- str = str.."["..GetType(i).."] = "..GetType(v)
- else
- str = str.."["..GetType(i).."] = "..GetType(v)..", "
- end
- numb = numb + 1
- end
- str = str.."}"
- return str
- elseif type(item) == "userdata" then
- local a,b = pcall(function()
- return item.ClassName
- end)
- if a then
- return item:GetFullName()
- else
- if tostring(b):match("not a valid member of %w+") then
- local c, d = tostring(b):match("not a valid member of %w+"):find("of ")
- local class = tostring(b):match("not a valid member of %w+"):sub(d+1)
- return class..".new(".. tostring(item) ..")"
- end
- end
- else
- return tostring(item)
- end
- end
- function getargs(event, method, Table)
- local max = 0
- local numb = 1
- local argz = {}
- local script = "\n-------R2S-------\n--This was made with my shitty RS\n\n\n";
- local arg_num = 1
- local list = ""
- for i,v in pairs(Table) do
- max = max + 1
- arg_num = arg_num + 1
- end
- for i,v in pairs(Table) do
- script = script.. "local A_"..i.." = "..GetType(v).."\n"
- table.insert(argz,"A_"..i)
- end
- script = script.."local Event = "..event.."\n\n".."Event:"..method.."("..table.concat(argz,", ")..")".."\n\n-------R2S-------"
- print(script)
- for i,v in pairs(Table) do
- if numb == max then
- list = list..GetType(v)
- else
- list = list..GetType(v)..", "
- end
- numb = numb + 1
- end
- return event..":"..method.."("..list..")";
- end
Advertisement
Add Comment
Please, Sign In to add comment