Advertisement
SythicalScripts

Sythical | #15

Jun 29th, 2022
607
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.49 KB | None | 0 0
  1. -- Bot Settings
  2. getgenv().AimSens = 1/45; -- Aimbot sens
  3. getgenv().LookSens = 1/80; -- Aim while walking sens
  4. getgenv().PreAimDis = 55; -- if within 55 Studs then preaim
  5. getgenv().KnifeOutDis = 85; -- if within 85 Studs then swap back to gun
  6. getgenv().ReloadDis = 50; -- if over 50 Studs away then reload
  7. getgenv().RecalDis = 15; -- if player moves over this many studs then recalculate path to them
  8.  
  9. -- Services
  10. local PathfindingService = game:GetService("PathfindingService")
  11. local Players = game:GetService("Players")
  12. local RunService = game:GetService("RunService")
  13. local TweenService = game:GetService('TweenService');
  14. local VIM = game:GetService("VirtualInputManager")
  15. local UserInputService = game:GetService("UserInputService")
  16.  
  17. -- Local Plr
  18. local Plr = Players.LocalPlayer
  19. local Char = Plr.Character or Plr.CharacterAdded:Wait()
  20. local Head = Char:WaitForChild("Head", 1337)
  21. local Root = Char:WaitForChild("HumanoidRootPart", 1337)
  22. local Humanoid = Char:WaitForChild("Humanoid", 1337)
  23.  
  24. -- error bypass
  25. for i,v in pairs(getconnections(game:GetService("ScriptContext").Error)) do v:Disable() end
  26.  
  27. -- Simple ESP
  28. loadstring(game:HttpGet("https://raw.githubusercontent.com/Babyhamsta/RBLX_Scripts/main/Universal/SimpleESP.lua", true))()
  29.  
  30. -- Aimbot Vars
  31. local Camera = workspace.CurrentCamera;
  32.  
  33. -- Mouse
  34. local Mouse = Plr:GetMouse();
  35.  
  36. -- Map Spawns
  37. local Spawns = workspace:WaitForChild("Map", 1337):WaitForChild("Spawns", 1337)
  38.  
  39. -- Ignore
  40. local Map = workspace:WaitForChild("Map", 1337)
  41. local RayIgnore = workspace:WaitForChild("Ray_Ignore", 1337)
  42. local MapIgnore = Map:WaitForChild("Ignore", 1337)
  43.  
  44. -- Temp Vars
  45. local ClosestPlr;
  46. local IsAiming;
  47. local InitialPosition;
  48. local CurrentEquipped = "Gun";
  49. local WalkToObject;
  50.  
  51. -- Get Closest plr
  52. local function getClosestPlr()
  53. local nearestPlayer, nearestDistance
  54. for _, player in pairs(Players:GetPlayers()) do
  55. if player.TeamColor ~= Plr.TeamColor and player ~= Plr then
  56. local character = player.Character
  57. if character then
  58. local nroot = character:FindFirstChild("HumanoidRootPart")
  59. if character and nroot and character:FindFirstChild("Spawned") then
  60. local distance = Plr:DistanceFromCharacter(nroot.Position)
  61. if (nearestDistance and distance >= nearestDistance) then continue end
  62. nearestDistance = distance
  63. nearestPlayer = player
  64. end
  65. end
  66. end
  67. end
  68. return nearestPlayer
  69. end
  70.  
  71. -- Wallcheck / Visible Check
  72. local function IsVisible(target, ignorelist)
  73. local obsParts = Camera:GetPartsObscuringTarget({target}, ignorelist);
  74.  
  75. if #obsParts == 0 then
  76. return true;
  77. else
  78. return false;
  79. end
  80. end
  81.  
  82. -- Aimbot/Triggerbot
  83. local function Aimlock()
  84. -- Temp Holder
  85. local aimpart = nil;
  86.  
  87. -- Detect first visible part
  88. if ClosestPlr and ClosestPlr.Character then
  89. for i,v in ipairs(ClosestPlr.Character:GetChildren()) do
  90. if v and v:IsA("Part") then -- is part
  91. if IsVisible(v.Position,{Camera,Char,ClosestPlr.Character,RayIgnore,MapIgnore}) then -- is visible
  92. aimpart = v;
  93. break;
  94. end
  95. end
  96. end
  97. end
  98.  
  99. -- If visible aim and shoot
  100. if aimpart then
  101. IsAiming = true;
  102. -- Aim at player
  103. local tcamcframe = Camera.CFrame;
  104. for i = 0, 1, AimSens do
  105. if not aimpart then break; end
  106. if (Head.Position.Y + aimpart.Position.Y) < 0 then break; end -- Stop bot from aiming at the ground
  107. Camera.CFrame = tcamcframe:Lerp(CFrame.new(Camera.CFrame.p, aimpart.Position), i)
  108. task.wait(0)
  109. end
  110.  
  111. -- Mouse down and back up
  112. VIM:SendMouseButtonEvent(Mouse.X, Mouse.Y, 0, true, game, 1)
  113. task.wait(0.25)
  114. VIM:SendMouseButtonEvent(Mouse.X, Mouse.Y, 0, false, game, 1)
  115. end
  116.  
  117. IsAiming = false;
  118. end
  119.  
  120. local function OnPathBlocked()
  121. -- try again
  122. warn("[AimmyAI] - Path was blocked, trying again.")
  123. WalkToObject();
  124. end
  125.  
  126. -- Pathfinding to Plr function
  127. WalkToObject = function()
  128. if ClosestPlr and ClosestPlr.Character then
  129. -- RootPart
  130. local CRoot = ClosestPlr.Character:FindFirstChild("HumanoidRootPart")
  131. if CRoot then
  132. -- Get start position
  133. InitialPosition = CRoot.Position;
  134.  
  135. -- Calculate path and waypoints
  136. local currpath = PathfindingService:CreatePath({["WaypointSpacing"] = 4, ["AgentHeight"] = 5, ["AgentRadius"] = 3, ["AgentCanJump"] = true});
  137.  
  138. -- Listen for block connect
  139. currpath.Blocked:Connect(OnPathBlocked)
  140.  
  141. local success, errorMessage = pcall(function()
  142. currpath:ComputeAsync(Root.Position, CRoot.Position)
  143. end)
  144. if success and currpath.Status == Enum.PathStatus.Success then
  145. local waypoints = currpath:GetWaypoints();
  146.  
  147. -- Navigate to each waypoint
  148. for i, wap in pairs(waypoints) do
  149. -- Catcher
  150. if i == 1 then continue end -- skip first waypoint
  151. if not ClosestPlr or not ClosestPlr.Character or ClosestPlr ~= getClosestPlr() or not ClosestPlr.Character:FindFirstChild("Spawned") or not Char:FindFirstChild("Spawned") then
  152. ClosestPlr = nil;
  153. return;
  154. elseif (InitialPosition - CRoot.Position).Magnitude > RecalDis then -- moved too far from start
  155. WalkToObject(); -- restart
  156. return;
  157. end
  158.  
  159. -- Detect if needing to jump
  160. if wap.Action == Enum.PathWaypointAction.Jump then
  161. Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
  162. end
  163.  
  164. -- Aim while walking (either path or plr)
  165. task.spawn(function()
  166. local primary = ClosestPlr.Character.PrimaryPart.Position;
  167. local studs = Plr:DistanceFromCharacter(primary)
  168.  
  169. local tcamcframe = Camera.CFrame;
  170. for i = 0, 1, LookSens do
  171. if IsAiming then break; end
  172. if primary and studs then
  173. -- If close aim at player
  174. if math.floor(studs + 0.5) < PreAimDis then
  175. if ClosestPlr and ClosestPlr.Character then
  176. local CChar = ClosestPlr.Character;
  177. if Char:FindFirstChild("Head") and CChar and CChar:FindFirstChild("Head") then
  178. local MiddleAim = (Vector3.new(wap.Position.X,Char.Head.Position.Y,wap.Position.Z) + Vector3.new(CChar.Head.Position.X,CChar.Head.Position.Y,CChar.Head.Position.Z))/2;
  179. Camera.CFrame = tcamcframe:Lerp(CFrame.new(Camera.CFrame.p, MiddleAim), i);
  180. end
  181. end
  182. else -- else aim at waypoint
  183. local mixedaim = (Camera.CFrame.p.Y + Char.Head.Position.Y)/2;
  184. Camera.CFrame = tcamcframe:Lerp(CFrame.new(Camera.CFrame.p, Vector3.new(wap.Position.X,mixedaim,wap.Position.Z)), i);
  185. end
  186. end
  187. task.wait(0)
  188. end
  189. end)
  190.  
  191. -- Auto Knife out (for faster running and realism)
  192. task.spawn(function()
  193. local primary = ClosestPlr.Character.PrimaryPart.Position;
  194. local studs = Plr:DistanceFromCharacter(primary)
  195.  
  196. if primary and studs then
  197. local arms = Camera:FindFirstChild("Arms");
  198. if arms then
  199. arms = arms:FindFirstChild("Real");
  200. if math.floor(studs + 0.5) > KnifeOutDis and not IsVisible(primary, {Camera,Char,ClosestPlr.Character,RayIgnore,MapIgnore}) then
  201. if arms.Value ~= "Knife" and CurrentEquipped == "Gun" then
  202. VIM:SendKeyEvent(true, Enum.KeyCode.Q, false, game);
  203. CurrentEquipped = "Knife";
  204. end
  205. elseif arms.Value == "Knife" and CurrentEquipped ~= "Gun" then
  206. VIM:SendKeyEvent(true, Enum.KeyCode.Q, false, game);
  207. CurrentEquipped = "Gun";
  208. end
  209. end
  210. end
  211. end)
  212.  
  213. -- Move to Waypoint
  214. if Humanoid then
  215. Humanoid:MoveTo(wap.Position);
  216. Humanoid.MoveToFinished:Wait(); -- Wait for us to get to Waypoint
  217. end
  218. end
  219. else
  220. -- Can't find path, move to a random spawn.
  221. warn("[AimmyAI] - Unable to calculate path!");
  222. end
  223. end
  224. end
  225. end
  226.  
  227. -- Walk to the Plr
  228. local function WalkToPlr()
  229. -- Get Closest Plr
  230. ClosestPlr = getClosestPlr();
  231.  
  232. -- Walk to Plr
  233. if ClosestPlr and ClosestPlr.Character and ClosestPlr.Character:FindFirstChild("HumanoidRootPart") then
  234. if Humanoid.WalkSpeed > 0 and Char:FindFirstChild("Spawned") and ClosestPlr.Character:FindFirstChild("Spawned") then
  235. --Create ESP
  236. local studs = Plr:DistanceFromCharacter(ClosestPlr.Character.PrimaryPart.Position)
  237. SESP_Create(ClosestPlr.Character.Head, ClosestPlr.Name, "TempTrack", Color3.new(1, 0, 0), math.floor(studs + 0.5));
  238.  
  239. -- Auto Reload (if next plr is far enough and out of site)
  240. if math.floor(studs + 0.5) > ReloadDis and not IsVisible(ClosestPlr.Character.HumanoidRootPart.Position, {Camera,Char,ClosestPlr.Character,RayIgnore,MapIgnore}) then
  241. VIM:SendKeyEvent(true, Enum.KeyCode.R, false, game)
  242. end
  243.  
  244. -- AI Walk to Plr
  245. WalkToObject(ClosestPlr.Character.HumanoidRootPart);
  246. end
  247. else
  248. --RandomWalk();
  249. end
  250. end
  251.  
  252. -- Loop Pathfind
  253. task.spawn(function()
  254. while task.wait() do
  255. if (ClosestPlr == nil or ClosestPlr ~= getClosestPlr()) then
  256. SESP_Clear("TempTrack");
  257. WalkToPlr();
  258. end
  259. end
  260. end)
  261.  
  262. -- Loop Aimlock
  263. task.spawn(function()
  264. while task.wait() do
  265. if ClosestPlr ~= nil and Camera then
  266. if Char:FindFirstChild("Spawned") and Humanoid.WalkSpeed > 0 then
  267. Aimlock();
  268. end
  269. end
  270. end
  271. end)
  272.  
  273. -- Detect Stuck Bot
  274. local stuckamt = 0;
  275. Humanoid.Running:Connect(function(speed)
  276. if speed < 3 and Char:FindFirstChild("Spawned") and Humanoid.WalkSpeed > 0 then
  277. stuckamt = stuckamt + 1;
  278. if stuckamt == 4 then
  279. -- Double jump
  280. Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
  281. Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
  282. elseif stuckamt >= 10 then
  283. stuckamt = 0;
  284. -- Clear and redo path
  285. SESP_Clear("TempTrack");
  286. WalkToPlr();
  287. end
  288. end
  289. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement