Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local game_meta = getrawmetatable(game)
- local game_namecall = game_meta.__namecall
- local namecall_dump = {}
- local current_rmt = nil
- local g_caller = nil
- local f_return = nil
- local Step = game:GetService("RunService").Stepped
- local mwr
- if setreadonly ~= nil then
- mwr = function()
- setreadonly(game_meta, false)
- end
- elseif make_writeable ~= nil then
- mwr = function()
- make_writeable(game_meta)
- end
- end
- mwr()
- local namecall_script = function(object, method, ...)
- local script = "-- Script generated by R2Sv2\n-- R2Sv2 developed by Luckyxero\n\32\n"
- local args = {}
- for i, v in pairs{...} do
- script = script .. "local A_" .. i .. " = " .. (type(v) == "table" and Table_TS(v) or GetType(v)) .. "\n"
- table.insert(args, "A_" .. i)
- end
- script = script .. "local Event = " .. GetPath(object) .. "\n\n"
- script = script .. "Event:" .. method .. "(" .. table.concat(args, ", ") .. ")"
- return script
- end
- local dump_script = function(script)
- Source:ClearAllChildren()
- local lines = 0
- script:gsub("[^\r\n]+", function(c)
- lines = lines + 1
- local tabs = 0
- c:gsub("%\t", function() tabs = tabs + 1 end)
- local line = ScriptLine:Clone()
- line.Parent = Source
- line.SourceText.Text = c
- line.Line.Text = lines
- line.RemoteHighlight.Text = Highlight(c, {"FireServer", "InvokeServer", "invokeServer", "fireServer"})
- line.Position = UDim2.new(0, tabs * (17 * 2), 0, -17 + #Source:GetChildren() * 17)
- line.Globals.Text = Highlight(c, global_env)
- line.Line.Position = UDim2.new(0, 0 - tabs * (17 * 2), 0, 0)
- line.Strings.Text = strings(c)
- line.Keywords.Text = Highlight(c, lua_keywords)
- line.Tokens.Text = Tokens(c)
- line.Comments.Text = comments(c)
- end)
- end
- local log_remote = function(table)
- if SetRemotes[table.object.Name].Enabled.Text == "Disabled" then return end
- local B = RBTN:Clone()
- g_caller = table.caller
- remotes_fired = remotes_fired + 1
- Total.Text = remotes_fired
- B.Parent = Remotes
- B.Position = UDim2.new(0, 10, 0, -20 + #Remotes:GetChildren() * 30)
- B.Icon.Image = table.method == "FireServer" and "rbxassetid://413369506" or "rbxassetid://413369623"
- B.RemoteName.Text = table.object.Name
- B.ID.Text = tostring(remotes_fired)
- B.MouseButton1Down:Connect(function()
- dump_script(table.script)
- g_caller = table.caller
- f_return = table.freturn == nil and table.object.Name .. " is not RemoteFunction" or table.freturn
- end)
- end
- local get_namecall_dump = function(script, object, ...)
- local Ret = nil
- if object.ClassName == "RemoteFunction" then
- local freturn = {pcall(object.InvokeServer, object, ...)}
- freturn = {select(2, unpack(freturn))}
- if #freturn == 0 then
- Ret = object.Name .. " is a void type RemoteFunction."
- else
- Ret = Table_TS(freturn)
- end
- end
- namecall_dump[#namecall_dump + 1] =
- {
- script = namecall_script(object, object.ClassName == "RemoteEvent" and "FireServer" or "InvokeServer", ...),
- caller = script,
- object = object,
- method = object.ClassName == "RemoteEvent" and "FireServer" or "InvokeServer",
- freturn = Ret
- }
- end
- GetReturn.MouseButton1Down:Connect(function()
- dump_script(f_return)
- end)
- Decompile.MouseButton1Down:Connect(function()
- local source = decompile(g_caller)
- dump_script(type(source) == "boolean" and "Failed to decompile caller script!" or source)
- end)
- Step:Connect(function()
- while #namecall_dump > 0 do
- log_remote(table.remove(namecall_dump, 1))
- end
- end)
- local on_namecall = function(object, ...)
- local method = select(#{...}, ...)
- local args = {...}
- args[#args] = nil
- if object.Name ~= "CharacterSoundEvent" and method:match("Server") and spy_enabled == true then get_namecall_dump(getfenv(2).script, object, unpack(args)) end
- return game_namecall(object, ...)
- end
- game_meta.__namecall = on_namecall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement