Advertisement
Guest User

temporal aimbot!

a guest
Nov 11th, 2019
4,058
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.88 KB | None | 0 0
  1. X_CHANGE = 0.1 --The change in camera angle on the X axis upon moving 1 pixel on 0.36 sensitivity.
  2. Y_CHANGE = 0.13 --The change in camera angle on the Y axis upon moving 1 pixel on 0.36 sensitivity.
  3. MOUSE_OFFSET = Vector2.new(0, 0) --The offset (in pixels) of where the script should think the mouse is.
  4. USE_RIGHT_CLICK = true --Whether or not to still use right click for locking on.
  5. AIM_KEY = nil --Enum.Keycode for the key to press when you want to lock onto someone.
  6.  
  7. --Temporal Aimbot
  8. wait()
  9.  
  10. --Custom Game Support
  11.  
  12. local games = {
  13. {GameId = 532222553, X_CHANGE = 0.05, Y_CHANGE = 0.04, MOUSE_OFFSET = Vector2.new(31, -1)}, --Island Royale
  14. {GameId = 113491250, X_CHANGE = 0.14, Y_CHANGE = 0.14, MOUSE_OFFSET = Vector2.new(0, 0)}, --Phantom Forces
  15. {GameId = 1168263273, X_CHANGE = 0.08, Y_CHANGE = 0.08, MOUSE_OFFSET = Vector2.new(0, 0)} --Bad Buisness
  16. }
  17.  
  18. local isBB = false
  19. if game.GameId == 1168263273 then
  20. characters = workspace.Characters
  21. isBB = true
  22. end
  23.  
  24. for i,v in pairs (games) do
  25. if game.GameId == v.GameId then
  26. X_CHANGE = v.X_CHANGE
  27. Y_CHANGE = v.Y_CHANGE
  28. MOUSE_OFFSET = v.MOUSE_OFFSET
  29. end
  30. end
  31.  
  32. --Variables
  33. local version = "1.4a"
  34.  
  35. local stopped = false
  36. local minimized = false
  37.  
  38. local _settings = {
  39. enabled = true,
  40. ffa = false,
  41. range = 150,
  42. predict = true,
  43. showRange = true
  44. }
  45.  
  46. local RunService = game:GetService("RunService") --Get the Run Service.
  47. local InputService = game:GetService("UserInputService") --Get the User Input Service.
  48. local Players = game:GetService("Players") --Get the Players service.
  49. local player = Players.LocalPlayer --Get the Local Player.
  50. local playerGui = player.PlayerGui
  51. local mouse = player:GetMouse()
  52. local camera = workspace.CurrentCamera
  53. local p = Input or {MoveMouse = nil} --Setup for ProtoSmasher mouse movement.
  54. local MoveMouse = mousemoverel or p.MoveMouse --Get the mouse move function.
  55. local gui = game:GetObjects("rbxassetid://3757696276")[1]
  56. gui.Parent = game:GetService("CoreGui")
  57. local main = gui.Main
  58. local top = main.Top
  59. local buttons = main.Buttons
  60. local clicking = {L = false, R = false}
  61.  
  62. top.Title.Text = "Temporal v"..version
  63.  
  64. --Functions
  65.  
  66. function rotateCamera(x, y) --Function for rotating camera along X and Y axis with the MoveMouse function.
  67. MoveMouse(y / Y_CHANGE, x / X_CHANGE) --Move the mouse to turn the camera.
  68. end
  69.  
  70. function isHovering(frame)
  71. local aPos = frame.AbsolutePosition
  72. local aSiz = frame.AbsoluteSize
  73.  
  74. if mouse.X >= aPos.X and mouse.X <= aPos.X + aSiz.X and mouse.Y >= aPos.Y and mouse.Y <= aPos.Y + aSiz.Y then
  75. return true
  76. else
  77. return false
  78. end
  79. end
  80.  
  81. --Events
  82.  
  83. top.Close.MouseButton1Click:Connect(function()
  84. stopped = true
  85. wait()
  86. gui:Destroy()
  87. end)
  88.  
  89. top.Minimize.MouseButton1Click:Connect(function()
  90. minimized = not minimized
  91. if minimized then
  92. main.BackgroundTransparency = 1
  93. buttons.Visible = false
  94. main.Logo.Visible = false
  95. else
  96. main.BackgroundTransparency = 0
  97. buttons.Visible = true
  98. main.Logo.Visible = true
  99. end
  100. end)
  101.  
  102. function BB_localChr ()
  103. local _record = {math.huge, nil}
  104. for i,v in pairs (characters:GetChildren()) do
  105. if v.Body:FindFirstChild("Head") then
  106. local dist = (v.Body.Head.Position - camera.CFrame.Position).Magnitude
  107. if dist < _record[1] then
  108. _record[1] = dist
  109. _record[2] = v
  110. end
  111. end
  112. end
  113. return _record[2]
  114. end
  115.  
  116. function BB_isSameTeam (chr) --Special targetting function for Bad Buisness
  117. if chr and chr == BB_localChr() then
  118. return true
  119. end
  120. for i,v in pairs (playerGui:GetChildren()) do
  121. if v.Name == "NameGui" then
  122. if v.Adornee then
  123. if v.Adornee.Parent.Parent == chr then
  124. return true
  125. end
  126. end
  127. end
  128. end
  129. return false
  130.  
  131. end
  132.  
  133. local holding_aim = false
  134.  
  135. InputService.InputBegan:Connect(function(input)
  136. if input.KeyCode == AIM_KEY then
  137. holding_aim = true
  138. end
  139. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  140. clicking.L = true
  141. end
  142. if input.UserInputType == Enum.UserInputType.MouseButton2 and USE_RIGHT_CLICK then
  143. clicking.R = true
  144. end
  145. end)
  146.  
  147. InputService.InputEnded:Connect(function(input)
  148. if input.KeyCode == AIM_KEY then
  149. holding_aim = false
  150. end
  151. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  152. clicking.L = false
  153. end
  154. if input.UserInputType == Enum.UserInputType.MouseButton2 and USE_RIGHT_CLICK then
  155. clicking.R = false
  156. end
  157. end)
  158.  
  159. if not MoveMouse and false then --If no mouse movement function exists, then...
  160. error("Script failed: Your exploit has no mouse movement function") --...print this message.
  161. else --Otherwise, if the function does exist, then execute this code
  162.  
  163. print("Temporal Aimbot v"..version.." Starting...") --Print message.
  164.  
  165. wait(0.5)
  166.  
  167. local target = nil --The current player target
  168. local _prevPos = nil
  169. local record = {player = nil, distance = nil}
  170.  
  171. local mPos = Vector2.new(mouse.X, mouse.Y)
  172.  
  173. if not isBB then
  174. Players.PlayerRemoving:Connect(function(plr)
  175. if plr == target then
  176. target = nil
  177. _prevPos = nil
  178. record = {player = nil, distance = nil}
  179. end
  180. end)
  181. else
  182. characters.ChildRemoved:Connect(function(chr)
  183. if chr == target then
  184. target = nil
  185. _prevPos = nil
  186. record = {player = nil, distance = nil}
  187. end
  188. end)
  189. end
  190.  
  191. local dragging = false
  192. local prevPos = Vector2.new(mouse.X, mouse.Y)
  193.  
  194. function toggle (button)
  195. if button.BackgroundColor3 == Color3.new(0, 0, 0) then
  196. button.BackgroundColor3 = Color3.fromRGB(85, 0, 127)
  197. button.TextColor3 = Color3.new(0, 0, 0)
  198. else
  199. button.BackgroundColor3 = Color3.new(0, 0, 0)
  200. button.TextColor3 = Color3.fromRGB(85, 0, 127)
  201. end
  202. end
  203.  
  204. if _settings.enabled then
  205. toggle(buttons.Enabled)
  206. end
  207. if _settings.ffa then
  208. toggle(buttons.FFA)
  209. end
  210. if _settings.predict then
  211. toggle(buttons.Predict)
  212. end
  213. if _settings.showRange then
  214. toggle(buttons.ShowRange)
  215. end
  216.  
  217. buttons.Range.Text = "Range: "..tostring(_settings.range)
  218.  
  219. buttons.Range.FocusLost:Connect(function()
  220. local num = tonumber(buttons.Range.Text)
  221. if num then
  222. _settings.range = num
  223. buttons.Range.Text = "Range: "..tostring(num)
  224. else
  225. buttons.Range.Text = "Range: "..tostring(_settings.range)
  226. end
  227. end)
  228.  
  229. buttons.Enabled.MouseButton1Click:Connect(function()
  230. toggle(buttons.Enabled)
  231. _settings.enabled = not _settings.enabled
  232. end)
  233. buttons.FFA.MouseButton1Click:Connect(function()
  234. toggle(buttons.FFA)
  235. _settings.ffa = not _settings.ffa
  236. end)
  237. buttons.Predict.MouseButton1Click:Connect(function()
  238. toggle(buttons.Predict)
  239. _settings.predict = not _settings.predict
  240. end)
  241. buttons.ShowRange.MouseButton1Click:Connect(function()
  242. toggle(buttons.ShowRange)
  243. _settings.showRange = not _settings.showRange
  244. end)
  245.  
  246. RunService.RenderStepped:Connect(function() --Fires every frame, handles precice aiming
  247.  
  248. if _settings.enabled and not stopped then
  249.  
  250. mPos = Vector2.new(mouse.X, mouse.Y) + MOUSE_OFFSET
  251.  
  252. if not dragging and clicking.L and isHovering(top) then
  253. dragging = true
  254. elseif dragging and clicking.L then
  255. local dif = mPos - prevPos
  256. main.Position = main.Position + UDim2.new(0, dif.X, 0, dif.Y)
  257. else
  258. dragging = false
  259. end
  260.  
  261. local function t (txt)
  262. buttons.Hint.Text = txt
  263. end
  264.  
  265. if isHovering(buttons.Enabled) then
  266. t("Enable/disable the aimbot.")
  267. elseif isHovering(buttons.FFA) then
  268. t("Target players no matter the team they are on.")
  269. elseif isHovering(buttons.Predict) then
  270. t("Predict the location of targets 3 frames ahead to counter lag.")
  271. elseif isHovering(buttons.ShowRange) then
  272. t("Show a circle around your mouse that displays the range in which people will be targetted.")
  273. elseif isHovering(buttons.Range) then
  274. t("The max amount of pixels away from your mouse a player can be in order for them to be potentially targeted. Please note that the target is detirmened by whoever is closest to the camera, not distance from the mouse.")
  275. else
  276. t("Make sure to set your sensitivity to 0.36 (1 bar) or else the aimbot will freak out! Report any bugs to angeld23#6785 on Discord. Join the discord server: discord.me/temporal")
  277. end
  278.  
  279. if target then
  280.  
  281. if not isBB then
  282. if target.Character and target.Character:FindFirstChild("Head") and target.Character.Head:IsA("BasePart") and (clicking.R or holding_aim) and target.Character:FindFirstChild("Humanoid") and target.Character.Humanoid.Health > 0.01 then
  283.  
  284. local _sPos, onScreen = camera:WorldToScreenPoint(target.Character.Head.Position)
  285. local sPos = Vector2.new(_sPos.X, _sPos.Y)
  286. if onScreen then
  287.  
  288. local ray = camera:ScreenPointToRay(mPos.X, mPos.Y)
  289. local pos
  290. local _pos = target.Character.Head.Position
  291. if _settings.predict and _prevPos then
  292. pos = _pos + (_pos - _prevPos) * 3
  293. else
  294. pos = _pos
  295. end
  296.  
  297. local temp1 = CFrame.new(camera.CFrame.Position, pos)
  298. local temp2 = Instance.new("Part", workspace)
  299. temp2.Name = "a"..tostring(math.random(100, 10000000))
  300. temp2.Anchored = true
  301. temp2.CanCollide = false
  302. temp2.Transparency = 1
  303. temp2.CFrame = temp1
  304. local targetRotation = temp2.Orientation
  305. local temp3 = CFrame.new(camera.CFrame.Position, camera.CFrame.Position + ray.Direction)
  306. temp2.CFrame = temp3
  307. local currentRotation = temp2.Orientation
  308. temp2:Destroy()
  309.  
  310. if targetRotation.Y < -90 and currentRotation.Y > 90 then
  311. targetRotation = Vector3.new(targetRotation.X, targetRotation.Y + 360, targetRotation.Z)
  312. end
  313. if currentRotation.Y < -90 and targetRotation.Y > 90 then
  314. currentRotation = Vector3.new(currentRotation.X, currentRotation.Y + 360, currentRotation.Z)
  315. end
  316. if targetRotation.X < -90 and currentRotation.X > 90 then
  317. targetRotation = Vector3.new(targetRotation.X, targetRotation.X + 360, targetRotation.Z)
  318. end
  319. if currentRotation.X < -90 and targetRotation.X > 90 then
  320. currentRotation = Vector3.new(currentRotation.X, currentRotation.X + 360, currentRotation.Z)
  321. end
  322.  
  323. local dif = currentRotation - targetRotation
  324.  
  325. rotateCamera(dif.X, dif.Y)
  326.  
  327. _prevPos = _pos
  328.  
  329. else
  330. target = nil
  331. _prevPos = nil
  332. record = {player = nil, distance = nil}
  333. end
  334.  
  335. else
  336. target = nil
  337. _prevPos = nil
  338. record = {player = nil, distance = nil}
  339. end
  340. else
  341. if target.Body:FindFirstChild("Head") and target.Body.Head:IsA("BasePart") and (clicking.R or holding_aim) and target:FindFirstChild("Health") and target.Health.Value > 0 then
  342.  
  343. local _sPos, onScreen = camera:WorldToScreenPoint(target.Body.Head.Position)
  344. local sPos = Vector2.new(_sPos.X, _sPos.Y)
  345. if onScreen then
  346.  
  347. local ray = camera:ScreenPointToRay(mPos.X, mPos.Y)
  348. local pos
  349. local _pos = target.Body.Head.Position
  350. if _settings.predict and _prevPos then
  351. pos = _pos + (_pos - _prevPos) * 3
  352. else
  353. pos = _pos
  354. end
  355.  
  356. local temp1 = CFrame.new(camera.CFrame.Position, pos)
  357. local temp2 = Instance.new("Part", workspace)
  358. temp2.Name = "a"..tostring(math.random(100, 10000000))
  359. temp2.Anchored = true
  360. temp2.CanCollide = false
  361. temp2.Transparency = 1
  362. temp2.CFrame = temp1
  363. local targetRotation = temp2.Orientation
  364. local temp3 = CFrame.new(camera.CFrame.Position, camera.CFrame.Position + ray.Direction)
  365. temp2.CFrame = temp3
  366. local currentRotation = temp2.Orientation
  367. temp2:Destroy()
  368.  
  369. if targetRotation.Y < -90 and currentRotation.Y > 90 then
  370. targetRotation = Vector3.new(targetRotation.X, targetRotation.Y + 360, targetRotation.Z)
  371. end
  372. if currentRotation.Y < -90 and targetRotation.Y > 90 then
  373. currentRotation = Vector3.new(currentRotation.X, currentRotation.Y + 360, currentRotation.Z)
  374. end
  375. if targetRotation.X < -90 and currentRotation.X > 90 then
  376. targetRotation = Vector3.new(targetRotation.X, targetRotation.X + 360, targetRotation.Z)
  377. end
  378. if currentRotation.X < -90 and targetRotation.X > 90 then
  379. currentRotation = Vector3.new(currentRotation.X, currentRotation.X + 360, currentRotation.Z)
  380. end
  381.  
  382. local dif = currentRotation - targetRotation
  383.  
  384. rotateCamera(dif.X, dif.Y)
  385.  
  386. _prevPos = _pos
  387.  
  388. else
  389. target = nil
  390. _prevPos = nil
  391. record = {player = nil, distance = nil}
  392. end
  393.  
  394. else
  395. target = nil
  396. _prevPos = nil
  397. record = {player = nil, distance = nil}
  398. end
  399. end
  400.  
  401. end
  402.  
  403. prevPos = mPos
  404.  
  405. else
  406. target = nil
  407. _prevPos = nil
  408. record = {player = nil, distance = nil}
  409. end
  410.  
  411. if not stopped then
  412. main.Circle.Position = UDim2.new(0, mPos.X - main.AbsolutePosition.X, 0, mPos.Y - main.AbsolutePosition.Y)
  413. end
  414.  
  415. end)
  416.  
  417. while wait(0.1) do --Loop that fires less often, to save performance
  418.  
  419. local c = clicking.R or holding_aim --Shortcut for detecting lockon button
  420.  
  421. if c and _settings.enabled and not target and not stopped then
  422. if not isBB then
  423. for i,v in pairs (Players:GetPlayers()) do
  424. if v ~= player and (v.Team ~= player.Team or _settings.ffa) then
  425. if v.Character then
  426. if v.Character:FindFirstChild("Head") and v.Character.Head:IsA("BasePart") and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid:IsA("Humanoid") and v.Character.Humanoid.Health > 0.01 then
  427. local _sPos, onScreen = camera:WorldToScreenPoint(v.Character.Head.Position)
  428. local sPos = Vector2.new(_sPos.X, _sPos.Y)
  429. if onScreen then
  430. if (sPos - mPos).Magnitude <= _settings.range then
  431. local dist = (camera.CFrame.Position - v.Character.Head.Position).Magnitude
  432. if not record.player or dist < record.distance then
  433. record = {player = v, distance = dist}
  434. end
  435. end
  436. end
  437. end
  438. end
  439. end
  440. end
  441. else
  442. local lChr = BB_localChr()
  443. if lChr then
  444. for i,v in pairs (characters:GetChildren()) do
  445. if v ~= lChr and (not BB_isSameTeam(v) or _settings.ffa) then
  446. if v.Body:FindFirstChild("Head") and v.Body.Head:IsA("BasePart") and v:FindFirstChild("Health") and v.Health.Value > 0 then
  447. local _sPos, onScreen = camera:WorldToScreenPoint(v.Body.Head.Position)
  448. local sPos = Vector2.new(_sPos.X, _sPos.Y)
  449. if onScreen then
  450. if (sPos - mPos).Magnitude <= _settings.range then
  451. local dist = (camera.CFrame.Position - v.Body.Head.Position).Magnitude
  452. if not record.player or dist < record.distance then
  453. record = {player = v, distance = dist}
  454. end
  455. end
  456. end
  457. end
  458. end
  459. end
  460. end
  461. end
  462.  
  463. if record.player then
  464. target = record.player
  465. record = {player = nil, distance = nil}
  466. end
  467. elseif not c then
  468. target = nil
  469. _prevPos = nil
  470. record = {player = nil, distance = nil}
  471. end
  472.  
  473. main.Circle.Size = UDim2.new(0, _settings.range * 2, 0, _settings.range * 2)
  474.  
  475. if _settings.showRange and not stopped then
  476. main.Circle.Visible = true
  477. elseif not stopped then
  478. main.Circle.Visible = false
  479. end
  480. end
  481.  
  482. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement