Advertisement
Guest User

Anti-Exploit (Btools, RC7 & More) ROBLOX!

a guest
Feb 15th, 2018
1,682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RBScript 15.98 KB | None | 0 0
  1. -- Made By Rathiega For Bran_donRBX
  2.  
  3.  
  4. print("Anti-Exploit By Rathiega Loaded!")
  5. client = game:GetService('Players').LocalPlayer
  6. service = {
  7.         MarketPlace = game:service("MarketplaceService");
  8.         GamepassService = game:service("GamePassService");
  9.         ChatService = game:service("Chat");
  10.         Lighting = game:service("Lighting");
  11.         Player = game:service("Players").LocalPlayer;
  12.         PlayerGui = game:service("Players").LocalPlayer.PlayerGui;
  13.         Delete = function(obj,num) game:service("Debris"):AddItem(obj,(num or 0)) end;
  14.         FindMatch = function(obj, str) for ind,thing in pairs(obj:GetChildren()) do if thing.Name:find(str) then return thing end end end;
  15.         New = function(class,data)
  16.             local new = Instance.new(class)
  17.             if data then
  18.                 if type(data) == "table" then
  19.                     for val,prop in pairs(data) do
  20.                         new[val] = prop
  21.                     end
  22.                 elseif type(data) == "userdata" then
  23.                     new.Parent = data
  24.                 end
  25.             end
  26.             return new
  27.         end}
  28. function logError(plr,err) warn("CLIENT ERROR: "..tostring(err)) client.Remote.Send("LogError",err) end
  29. cPcall = function(func,...) local function cour(...) coroutine.resume(coroutine.create(func),...) end local ran,error=ypcall(cour,...) if error then print(error) logError(error) warn('ERROR :: '..error) end end
  30. Routine = function(func,...) coroutine.resume(coroutine.create(func),...) end
  31.         LastChanges = {
  32.             Lighting = {};
  33.         };
  34.         Detectors = {
  35.             Speed = function(data)
  36.                 service.StartLoop("AntiSpeed",1,function()
  37.                     if service.CheckMethod("GetRealPhysicsFPS") then
  38.                         if workspace:GetRealPhysicsFPS() > tonumber(data.Speed) then
  39.                             client.Anti.Detected('kill','Speed exploiting')
  40.                         end
  41.                     else
  42.                         client.Anti.Detected('kick','Method change detected')
  43.                     end
  44.                 end)
  45.             end;
  46.             LockLighting = function(data)
  47.                 local settings = {
  48.                     Ambient = service.Lighting.Ambient;
  49.                     Brightness = service.Lighting.Brightness;
  50.                     ColorShift_Bottom = service.Lighting.ColorShift_Bottom;
  51.                     ColorShift_Top = service.Lighting.ColorShift_Top;
  52.                     GlobalShadows = service.Lighting.GlobalShadows;
  53.                     OutdoorAmbient = service.Lighting.OutdoorAmbient;
  54.                     Outlines = service.Lighting.Outlines;
  55.                     ShadowColor = service.Lighting.ShadowColor;
  56.                     GeographicLatitude = service.Lighting.GeographicLatitude;
  57.                     Name = service.Lighting.Name;
  58.                     TimeOfDay = service.Lighting.TimeOfDay;            
  59.                     FogColor = service.Lighting.FogColor;
  60.                     FogEnd = service.Lighting.FogEnd;
  61.                     FogStart = service.Lighting.FogStart;
  62.                 }
  63.                 local checking = false
  64.                 Routine(function()
  65.                     while true do
  66.                         if not checking then
  67.                             for i,v in pairs(settings) do
  68.                                 if service.Lighting[i] ~= nil then
  69.                                     settings[i] = service.Lighting[i]
  70.                                 end
  71.                             end
  72.                         end
  73.                         wait(1)
  74.                     end
  75.                 end)
  76.                 client.Variables.LightingChanged = false
  77.                 local tempIgnore = false
  78.                 local function check(c)
  79.                     if client.Variables.LightingChanged then return true end
  80.                     local temp = service.Lighting[c]
  81.                     if service.Lighting[c] ~= nil and settings[c] ~= nil then
  82.                         tempIgnore = true
  83.                         service.Lighting[c] = settings[c]
  84.                         tempIgnore = false
  85.                         wait(0.01)
  86.                         if c == client.Anti.LastChanges.Lighting then
  87.                             tempIgnore = true
  88.                             service.Lighting[c] = temp
  89.                             tempIgnore = false
  90.                             return true
  91.                         else
  92.                             return false
  93.                         end
  94.                     end
  95.                 end
  96.                 service.Lighting.Changed:connect(function(c)
  97.                     checking = true
  98.                     if not tempIgnore then
  99.                         if check(c) then
  100.                             print("SERVER CHANGED IT")
  101.                         else
  102.                             print("CLIENT CHANGED IT")
  103.                         end
  104.                     end
  105.                     checking = false
  106.                 end)
  107.             end;
  108.            
  109.             ReplicationLogs = function()
  110.                 local filtering = workspace.FilteringEnabled
  111.                
  112.                 local function checkParent(obj,class)
  113.                     local tester; pcall(function() tester = obj:GetFullName() end)
  114.                     if tester then
  115.                         local full = obj:GetFullName()
  116.                         local prev = game
  117.                         local blackParents = {
  118.                             service.InsertService;
  119.                             service.TweenService;
  120.                             service.GamepadService;
  121.                             service.Workspace.CurrentCamera;
  122.                             service.LocalContainer();
  123.                             service.Player;
  124.                             service.Player.Character;
  125.                         }
  126.                        
  127.                         local blackClasses = {
  128.                             "TouchTransmitter";
  129.                         }
  130.                        
  131.                         local players = service.Players:GetPlayers()
  132.                        
  133.                         for ind,b in pairs(blackParents) do
  134.                             if b and (obj==b or obj:IsDescendantOf(b)) then
  135.                                 return true
  136.                             end
  137.                         end
  138.                        
  139.                         for ind,b in pairs(blackClasses) do
  140.                             if obj:IsA(b) then
  141.                                 return true
  142.                             end
  143.                         end
  144.                        
  145.                         for ind,p in pairs(players) do
  146.                             if p and (obj:IsDescendantOf(p) or (p.Character and obj:IsDescendantOf(p.Character)))then
  147.                                 return true
  148.                             end
  149.                         end
  150.                        
  151.                         local new = obj
  152.                         for i=1,50 do
  153.                             if new then
  154.                                 if (class and new:IsA(class)) and not (new.Name:find("ADONIS") and new:IsA("LocalScript")) then
  155.                                     return true
  156.                                 else
  157.                                     prev = new
  158.                                 end
  159.                             else
  160.                                 return false
  161.                             end
  162.                             new = obj.Parent
  163.                         end
  164.                        
  165.                         return false
  166.                     else
  167.                         --warn(client.Anti.GetClassName(obj))
  168.                         return true
  169.                     end
  170.                 end
  171.                
  172.                 game.DescendantAdded:connect(function(c)
  173.                     if not filtering and not checkParent(c) then
  174.                         local data = {}
  175.                         data.obj = c
  176.                         data.name = c.Name
  177.                         data.class = c.ClassName
  178.                         data.parent = c.Parent
  179.                         data.path = c:GetFullName()
  180.                         client.Remote.Fire("AddReplication","Created",c,data)
  181.                     end
  182.                 end)
  183.                 game.DescendantRemoving:connect(function(c)
  184.                     if not filtering and not checkParent(c) then
  185.                         local data = {}
  186.                         data.obj = c
  187.                         data.name = c.Name
  188.                         data.class = c.ClassName
  189.                         data.parent = c.Parent
  190.                         data.path = c:GetFullName()
  191.                         if c and c.Parent then
  192.                             local event;
  193.                             event = c.Parent.ChildRemoved:connect(function(n)
  194.                                 if c==n then
  195.                                     client.Remote.Fire("AddReplication","Destroyed",c,data)
  196.                                     event:disconnect()
  197.                                 end
  198.                             end)
  199.                             wait(5)
  200.                             if event then
  201.                                 event:disconnect()
  202.                             end
  203.                         else
  204.                             client.Remote.Fire("AddReplication","Destroyed",c,data)
  205.                         end
  206.                     end
  207.                 end)
  208.             end;
  209.             NameId = function(data)
  210.                 local realId = data.RealID
  211.                 local realName = data.RealName
  212.                 service.StartLoop("NameIDCheck",10,function()
  213.                     if service.Player.Name~=realName or service.Player.userId~=realId then
  214.                         client.Anti.Detected('kick','Local name/userID does not match real name/userID')
  215.                     end
  216.                 end)
  217.             end;
  218.             AntiGui = function(data)
  219.                 Routine(function()
  220.                     for i,g in pairs(service.PlayerGui:children()) do
  221.                         if g:IsA("PlayerGui") and not g.Name:find(client.CodeName) then
  222.                             local good=false
  223.                             for i,v in pairs(client.AllowedGuiList) do
  224.                                 if g.Name==v then
  225.                                     good=true
  226.                                 end
  227.                             end
  228.                             if not good then g:Destroy() client.Anti.Detected("log","GUI detected") end
  229.                         end
  230.                     end
  231.                 end)
  232.                 service.PlayerGui.ChildAdded:connect(function(g)
  233.                     cPcall(function()
  234.                         if g:IsA("PlayerGui") and not g.Name:find(client.CodeName) then
  235.                             local good=false
  236.                             for i,v in pairs(client.AllowedGuiList) do
  237.                                 if g.Name==v then
  238.                                     good=true
  239.                                 end
  240.                             end
  241.                             if not good then g:Destroy() client.Anti.Detected("log","Btools detected") end
  242.                         end
  243.                     end)
  244.                 end)
  245.             end;
  246.             HumanoidState = function(data)
  247.                 wait(1)
  248.                 local humanoid = service.Player.Character:WaitForChild("Humanoid")
  249.                 local event
  250.                 local doing = true
  251.                 event = humanoid.StateChanged:connect(function(old,new)
  252.                     if not doing then event:disconnect() end
  253.                     if new==Enum.HumanoidStateType.StrafingNoPhysics and doing then
  254.                         client.Anti.Detected("kill","Noclipping.")
  255.                         doing=false
  256.                         event:disconnect()
  257.                     end
  258.                 end)
  259.                 while humanoid and humanoid.Parent and humanoid.Parent.Parent and doing and wait(0.1) do
  260.                     if humanoid:GetState()==Enum.HumanoidStateType.StrafingNoPhysics and doing then
  261.                         client.Anti.Detected("kill","Noclipping.")
  262.                         doing=false
  263.                     end
  264.                 end
  265.             end;
  266.             Paranoid = function(data)
  267.                 wait(1)
  268.                 local char = service.Player.Character
  269.                 local torso = char:WaitForChild("Torso")
  270.                 local humPart = char:WaitForChild("HumanoidRootPart")
  271.                 local hum = char:WaitForChild("Humanoid")
  272.                 while torso and humPart and torso.Parent==char and humPart.Parent==char and char.Parent~=nil and hum.Health>0 and hum and hum.Parent and wait(1) do
  273.                     if (humPart.Position-torso.Position).magnitude>10 and hum and hum.Health>0 then
  274.                         client.Anti.Detected("kill","Paranoid detected")
  275.                     end
  276.                 end
  277.             end;
  278.             MainDetection = function(data)
  279.                 local lastUpdate = tick()
  280.                 local doingCrash = false
  281.                 local lookFor = {
  282.                     'stigma';
  283.                     'sevenscript';
  284.                     "a".."ssh".."ax";
  285.                     'elysian';
  286.                     'current identity is 0';
  287.                     'gui made by kujo';
  288.                 }
  289.                
  290.                 local files = {
  291.                     ["C:\RC7\rc7.dat"] = true;
  292.                     ["C:\RC7\RC7_THEMES"] = true;
  293.                     ["C:\RC7\RC8_THEMES"] = true;
  294.                 }
  295.                
  296.                 local function check(Message)
  297.                     for i,v in pairs(lookFor) do
  298.                         if Message:lower():find(v:lower()) and not Message:lower():find("failed to load") then
  299.                             return true
  300.                         end
  301.                     end
  302.                 end
  303.                
  304.                 local function findLog(msg)
  305.                     for i,v in pairs(service.LogService:GetLogHistory()) do
  306.                         if v.message:lower():find(msg:lower()) then
  307.                             return true
  308.                         end
  309.                     end
  310.                 end
  311.                
  312.                 local function findFiles()
  313.                     local image = service.New("Decal",service.Workspace)
  314.                     for i,v in pairs(files) do
  315.                         image.Texture = i;
  316.                         wait(0.5)
  317.                         if findLog(i) then
  318.                         else
  319.                             warn("Exploting Detected!")
  320.                             client.Anti.Detected('crash','RC7 detected.')
  321.                         end
  322.                     end
  323.                 end
  324.                 local function chkObj(item)
  325.                     if client.Anti.ObjRLocked(item) then
  326.                         local cont = true
  327.                         local ran,failz = ypcall(function()
  328.                             local checks = {
  329.                                 service.Workspace;
  330.                                 service.Players;
  331.                                 service.ReplicatedStorage;
  332.                                 service.ReplicatedFirst;
  333.                                 service.Lighting;
  334.                                 service.SoundService;
  335.                                 service.StarterPack;
  336.                                 service.StarterPlayer;
  337.                                 service.Teams;
  338.                                 service.HttpService;
  339.                             }
  340.                             for i,v in pairs(checks) do
  341.                                 if item:IsDescendantOf(v) then cont = false end
  342.                             end
  343.                         end)
  344.                         if cont then
  345.                             local cont = false
  346.                             local class = client.Anti.GetClassName(item)
  347.                             if class then
  348.                                 local checks={
  349.                                     "Script";
  350.                                     "LocalScript";
  351.                                     "CoreScript";
  352.                                     "ScreenGui";
  353.                                     "Frame";
  354.                                     "TextLabel";
  355.                                     "TextButton";
  356.                                     "ImageLabel";
  357.                                     "TextBox";
  358.                                     "ImageButton";
  359.                                     "GuiMain"}
  360.                                 for i,v in pairs(checks) do
  361.                                     if class==v then
  362.                                         cont = true
  363.                                     end
  364.                                 end
  365.                             end
  366.                             if cont then
  367.                                 local testName = tostring(math.random()..math.random())
  368.                                 local ye,err = ypcall(function()
  369.                                     game:GetService("GuiService"):AddSelectionParent(testName, item)
  370.                                     game:GetService("GuiService"):RemoveSelectionGroup(testName)
  371.                                 end)
  372.                                 if err and err:find(testName) and err:find("GuiService:") then return true end
  373.                                 wait(0.5)
  374.                                 for i,v in pairs(service.LogService:GetLogHistory()) do
  375.                                     if v.message:find(testName) and v.message:find("GuiService:") then
  376.                                         return true
  377.                                     end
  378.                                 end
  379.                             end
  380.                         end
  381.                     end
  382.                 end
  383.                 service.ReplicatedFirst.ChildAdded:connect(function(child)
  384.                     if client.Anti.GetClassName(child) == "LocalScript" then
  385.                         client.Anti.Detected("kick","RC7/Other")
  386.                     end
  387.                 end)
  388.                 service.LogService.MessageOut:connect(function(Message, Type)
  389.                     if check(Message) then
  390.                         client.Anti.Detected('crash','Exploit detected; '..Message)
  391.                     end
  392.                 end)
  393.                 service.ScriptContext.Error:connect(function(Message, Trace, Script)
  394.                     if (not Script or ((not Trace or Trace==""))) then
  395.                         local tab = service.LogService:GetLogHistory()
  396.                         local continue = false 
  397.                         if Script then
  398.                             for i,v in pairs(tab) do
  399.                                 if v.message==Message and tab[i+1] and tab[i+1].message==Trace then
  400.                                     continue = true
  401.                                 end
  402.                             end
  403.                         else
  404.                             continue=true
  405.                         end
  406.                         if continue then
  407.                             if tostring(Trace):find("CoreGui") or tostring(Trace):find("PlayerScripts") or tostring(Trace):find("Animation_Scripts") or tostring(Trace):match("^(%S*)%.(%S*)") then
  408.                                 return
  409.                             else
  410.                                 client.Anti.Detected("log","Traceless/Scriptless error")
  411.                             end
  412.                         end
  413.                     end
  414.                 end)
  415.                 service.NetworkClient.ChildRemoved:connect(function(child)
  416.                     wait(30)
  417.                     client.Functions.KillClient()
  418.                 end)
  419.                 game.DescendantAdded:connect(function(c)
  420.                     if chkObj(c) and type(c)=="userdata" and not doingCrash then
  421.                         doingCrash = true
  422.                         client.Anti.Detected("crash","New CoreGui Object")
  423.                     end
  424.                 end)
  425.             service.StartLoop("EventChecker","Heartbeat",function()
  426.                     lastUpdate = tick()
  427.             end)
  428.             service.Player:WaitForChild("Backpack").ChildAdded:connect(function(t)
  429.                     if t:IsA("HopperBin") then
  430.                         if t.BinType==Enum.BinType.Grab then
  431.                             client.Anti.Detected("log","Grab tool detected")
  432.                         elseif t.BinType==Enum.BinType.Clone then
  433.                             client.Anti.Detected("log","Clone tool detected")
  434.                         elseif t.BinType==Enum.BinType.Hammer then
  435.                             client.Anti.Detected("log","Hammer tool detected")
  436.                         elseif t.BinType==Enum.BinType.GameTool then
  437.                             client.Anti.Detected("log","BinType.GameTool detected")
  438.                         end
  439.                     end
  440.                 end)
  441.             service.StartLoop("Detection",10,function()
  442.                     if tick()-lastUpdate > 20 then
  443.                         client.Anti.Detected("crash","Events stopped")
  444.                     end
  445.                     for i,v in pairs(service.LogService:GetLogHistory()) do
  446.                         if check(v.message) then
  447.                             client.Anti.Detected('crash','Exploit detected')
  448.                         end
  449.                     end
  450.                     local ran,err = ypcall(function()
  451.                         local func,err = loadstring("print('LOADSTRING TEST')")
  452.                     end)
  453.                     if ran then
  454.                         client.Anti.Detected('crash','Exploit detected; Loadstring usable')
  455.                     end
  456.                     local ran,err = ypcall(function()
  457.                         local test = Instance.new("StringValue")
  458.                         test.RobloxLocked = true
  459.                     end)
  460.                     if ran then
  461.                         client.Anti.Detected('crash','RobloxLocked usable')
  462.                     end
  463.                 end)
  464.             end;
  465.             Launch = function(mode,data)
  466.             if client.Anti.Detectors[mode] then
  467.                 client.Anti.Detectors[mode](data)
  468.             end
  469.         end;
  470.         Detected = function(action,info)
  471.             pcall(client.Remote.Send,"Detected",action,info)
  472.             wait(1)
  473.             if action == "kick" then
  474.                 client.Disconnect()
  475.             elseif action == "crash" then
  476.                 client.Kill()
  477.             end
  478.         end;
  479.         GetClassName = function(obj)
  480.             local testName = tostring(math.random()..math.random())
  481.             local ran,err = ypcall(function()
  482.                 local test = obj[testName]
  483.             end)
  484.             if err then
  485.                 local class = err:match(testName.." is not a valid member of (.*)")
  486.                 if class then
  487.                     return class
  488.                 end
  489.             end
  490.         end;
  491.         RLocked = function(obj)
  492.             local ran,err=ypcall(function() local bob=service.New("StringValue",obj) bob:Destroy() end)
  493.             if ran then
  494.                 return false
  495.             else
  496.                 return true
  497.             end
  498.         end;
  499.         ObjRLocked = function(obj)
  500.             local ran,err=ypcall(function() obj.Parent=obj.Parent end)
  501.             if ran then
  502.                 return false
  503.             else
  504.                 return true
  505.             end
  506.         end;
  507.         CoreRLocked = function(obj)
  508.             local testName=tostring(math.random()..math.random())
  509.             local ye,err=ypcall(function()
  510.                 game:GetService("GuiService"):AddSelectionParent(testName, obj)
  511.                 game:GetService("GuiService"):RemoveSelectionGroup(testName)
  512.             end)
  513.             if err and err:find(testName) and err:find("GuiService:") then
  514.                 return true
  515.             else
  516.                 wait(0.5)
  517.                 for i,v in pairs(service.LogService:GetLogHistory()) do
  518.                     if v.message:find(testName) and v.message:find("GuiService:") then
  519.                         return true
  520.                     end
  521.                 end
  522.             end
  523.         end}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement