Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local getrawmetatable = assert(getrawmetatable, "Sorry, our script cannot run on this exploit due to its missing function `getrawmetatable`");
- local detectedProtection = newcclosure or protect_function or coroutine.wrap
- local gamerawMeta = getrawmetatable(game);
- if (setreadonly) then setreadonly(gamerawMeta, false) end;
- if (make_writeable) then make_writeable(gamerawMeta) end;
- local oldMeta = gamerawMeta.__namecall;
- local methodOfUse = {
- ["Fire"] = true,
- ["FireServer"] = true,
- ["Invoke"] = true,
- ["InvokeServer"] = true
- };
- local classNames = {
- ["BindableEvent"] = false,
- ["RemoteEvent"] = true,
- ["BindableFunction"] = true,
- ["RemoteFunction"] = true,
- ["Event"] = true,
- };
- local ignoredRemoteNames = {};
- local function GetPath(instanceObject)
- if (instanceObject == game) then return "game" end
- if (instanceObject.Parent == nil)then return instanceObject.Name end
- local returnString = "";
- while instanceObject.Parent ~= game do
- returnString = "["..instanceObject.Name.."]"..returnString
- instanceObject = instanceObject.Parent
- end
- if instanceObject == workspace then
- return "workspace"..returnString
- elseif pcall(game.GetService, game, instanceObject.ClassName) then
- return 'game:GetService("'.. instanceObject.ClassName ..'")'..returnString
- end
- return "game["..instanceObject.Name.."]"..returnString
- end
- function argumentsUnpack(mustBeTable)
- if (type(mustBeTable) ~= "table") then return end;
- local returnString, arguments = "", (mustBeTable);
- for index, value in pairs( arguments ) do
- local isType = typeof(value);
- if ( isType == "string" ) then
- returnString = returnString .. ", \"".. value .."\"";
- elseif ( isType == "table" ) then
- returnString = returnString .. ", {".. argumentsUnpack(value) .."}";
- elseif ( isType == "Vector2" ) then
- returnString = returnString .. ", [".. string.format("Vector2.new(%g, %g)",value.X,value.Y) .."]";
- elseif ( isType == "Vector3" ) then
- returnString = returnString .. ", [".. string.format("Vector3.new(%g, %g, %g)",value.X,value.Y,value.Z) .."]";
- elseif ( isType == "Color3" ) then
- returnString = returnString .. ", [".. string.format("Color3.new(%g, %g, %g)",value.r,value.g,value.b) .."]";
- elseif ( isType == "CFrame" ) then
- returnString = returnString .. ", [".. string.format("CFrame.new(%g, %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, %g)",value:components()) .."]";
- elseif ( isType == "UDim2" ) then
- returnString = returnString .. ", [".. string.format("UDim2.new(%g, %g, %g, %g)", value.X.Scale, value.X.Offset, value.Y.Scale, value.Y.Offset) .."]";
- elseif ( isType == "Instance" ) then
- returnString = returnString .. ", " ..GetPath(value);
- elseif ( isType == "userdata" ) then
- if not rawget(getrawmetatable(value), "__tostring") then
- returnString = returnString .. ", " .. tostring(value)
- else
- returnString = returnString .. ", [userdata]"
- end
- else
- returnString = returnString .. ", " .. tostring(value)
- end
- end
- return returnString:sub(3);
- end;
- gamerawMeta.__namecall = detectedProtection(function(self, ...)
- local argumentsCalled = {...};
- local methodName = argumentsCalled[#argumentsCalled]
- if methodOfUse[methodName] == nil or ignoredRemoteNames[self.Name] == true or classNames[self.ClassName] == nil or game:IsAncestorOf(self) then
- return oldMeta(self, ...)
- end
- argumentsCalled[#argumentsCalled] = nil
- local stringArgs = argumentsUnpack(argumentsCalled)
- warn(self.ClassName .. " was called!\nPath: " .. GetPath(self) .. "\nMethod: " .. methodName .. "\nArgs: " .. stringArgs);
- return oldMeta(self, ...)
- end)
Advertisement
Advertisement