Advertisement
AceRealmsYT_alt

Roblox anti-exploit

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