Advertisement
Damix2131

https://pastebin.com/raw/J1zN8CaL

Jun 25th, 2023
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.45 KB | None | 0 0
  1. --[[
  2. getgenv().AimPart = "HumanoidRootPart" -- For R15 Games: {UpperTorso, LowerTorso, HumanoidRootPart, Head} | For R6 Games: {Head, Torso, HumanoidRootPart}
  3. getgenv().AimlockToggleKey = "Y" -- Toggles Aimbot On/Off
  4. getgenv().AimRadius = 50 -- How far away from someones character you want to lock on at
  5. getgenv().ThirdPerson = false -- Locking onto someone in your Third Person POV
  6. getgenv().FirstPerson = true -- Locking onto someone in your First Person POV
  7. getgenv().TeamCheck = false -- Check if Target is on your Team (True means it wont lock onto your teamates, false is vice versa) (Set it to false if there are no teams)
  8. getgenv().PredictMovement = true -- Predicts if they are moving in fast velocity (like jumping) so the aimbot will go a bit faster to match their speed
  9. getgenv().PredictionVelocity = 10 -- The speed of the PredictMovement feature
  10. ]]--
  11.  
  12. local Players, Uis, RService, SGui = game:GetService"Players", game:GetService"UserInputService", game:GetService"RunService", game:GetService"StarterGui";
  13. local Client, Mouse, Camera, CF, RNew, Vec3, Vec2 = Players.LocalPlayer, Players.LocalPlayer:GetMouse(), workspace.CurrentCamera, CFrame.new, Ray.new, Vector3.new, Vector2.new;
  14. local Aimlock, MousePressed, CanNotify = true, false, false;
  15. local AimlockTarget;
  16. getgenv().CiazwareUniversalAimbotLoaded = true
  17.  
  18. getgenv().SeparateNotify = function(title, text, icon, time)
  19. SGui:SetCore("SendNotification",{
  20. Title = title;
  21. Text = text;
  22. Duration = time;
  23. })
  24. end
  25.  
  26. getgenv().Notify = function(title, text, icon, time)
  27. if CanNotify == true then
  28. if not time or not type(time) == "number" then time = 3 end
  29. SGui:SetCore("SendNotification",{
  30. Title = title;
  31. Text = text;
  32. Duration = time;
  33. })
  34. end
  35. end
  36.  
  37. getgenv().WorldToViewportPoint = function(P)
  38. return Camera:WorldToViewportPoint(P)
  39. end
  40.  
  41. getgenv().WorldToScreenPoint = function(P)
  42. return Camera.WorldToScreenPoint(Camera, P)
  43. end
  44.  
  45. getgenv().GetObscuringObjects = function(T)
  46. if T and T:FindFirstChild(getgenv().AimPart) and Client and Client.Character:FindFirstChild("Head") then
  47. local RayPos = workspace:FindPartOnRay(RNew(
  48. T[getgenv().AimPart].Position, Client.Character.Head.Position)
  49. )
  50. if RayPos then return RayPos:IsDescendantOf(T) end
  51. end
  52. end
  53.  
  54. getgenv().GetNearestTarget = function()
  55. -- Credits to whoever made this, i didnt make it, and my own mouse2plr function kinda sucks
  56. local players = {}
  57. local PLAYER_HOLD = {}
  58. local DISTANCES = {}
  59. for i, v in pairs(Players:GetPlayers()) do
  60. if v ~= Client then
  61. table.insert(players, v)
  62. end
  63. end
  64. for i, v in pairs(players) do
  65. if v.Character ~= nil then
  66. local AIM = v.Character:FindFirstChild("Head")
  67. if getgenv().TeamCheck == true and v.Team ~= Client.Team then
  68. local DISTANCE = (v.Character:FindFirstChild("Head").Position - game.Workspace.CurrentCamera.CFrame.p).magnitude
  69. local RAY = Ray.new(game.Workspace.CurrentCamera.CFrame.p, (Mouse.Hit.p - game.Workspace.CurrentCamera.CFrame.p).unit * DISTANCE)
  70. local HIT,POS = game.Workspace:FindPartOnRay(RAY, game.Workspace)
  71. local DIFF = math.floor((POS - AIM.Position).magnitude)
  72. PLAYER_HOLD[v.Name .. i] = {}
  73. PLAYER_HOLD[v.Name .. i].dist= DISTANCE
  74. PLAYER_HOLD[v.Name .. i].plr = v
  75. PLAYER_HOLD[v.Name .. i].diff = DIFF
  76. table.insert(DISTANCES, DIFF)
  77. elseif getgenv().TeamCheck == false and v.Team == Client.Team then
  78. local DISTANCE = (v.Character:FindFirstChild("Head").Position - game.Workspace.CurrentCamera.CFrame.p).magnitude
  79. local RAY = Ray.new(game.Workspace.CurrentCamera.CFrame.p, (Mouse.Hit.p - game.Workspace.CurrentCamera.CFrame.p).unit * DISTANCE)
  80. local HIT,POS = game.Workspace:FindPartOnRay(RAY, game.Workspace)
  81. local DIFF = math.floor((POS - AIM.Position).magnitude)
  82. PLAYER_HOLD[v.Name .. i] = {}
  83. PLAYER_HOLD[v.Name .. i].dist= DISTANCE
  84. PLAYER_HOLD[v.Name .. i].plr = v
  85. PLAYER_HOLD[v.Name .. i].diff = DIFF
  86. table.insert(DISTANCES, DIFF)
  87. end
  88. end
  89. end
  90.  
  91. if unpack(DISTANCES) == nil then
  92. return nil
  93. end
  94.  
  95. local L_DISTANCE = math.floor(math.min(unpack(DISTANCES)))
  96. if L_DISTANCE > getgenv().AimRadius then
  97. return nil
  98. end
  99.  
  100. for i, v in pairs(PLAYER_HOLD) do
  101. if v.diff == L_DISTANCE then
  102. return v.plr
  103. end
  104. end
  105. return nil
  106. end
  107.  
  108. --[[getgenv().CheckTeamsChildren = function()
  109. if workspace and workspace:FindFirstChild"Teams" then
  110. if getgenv().TeamCheck == true then
  111. if #workspace.Teams:GetChildren() == 0 then
  112. getgenv().TeamCheck = false
  113. SeparateNotify("Ciazware", "TeamCheck set to: "..tostring(getgenv().TeamCheck).." because there are no teams!", "", 3)
  114. end
  115. end
  116. end
  117. end
  118. CheckTeamsChildren()
  119. ]]--
  120.  
  121. --[[getgenv().GetNearestTarget = function()
  122. local T;
  123. for _, p in next, Players:GetPlayers() do
  124. if p ~= Client then
  125. if p.Character and p.Character:FindFirstChild(getgenv().AimPart) then
  126. if getgenv().TeamCheck == true and p.Team ~= Client.Team then
  127. local Pos, ScreenCheck = WorldToScreenPoint(p.Character[getgenv().AimPart].Position)
  128. Pos = Vec2(Pos.X, Pos.Y)
  129. local MPos = Vec2(Mouse.X, Mouse.Y) -- Credits to CriShoux for this
  130. local Distance = (Pos - MPos).Magnitude;
  131. if Distance < getgenv().AimRadius then
  132. T = p
  133. end
  134. elseif getgenv().TeamCheck == false and p.Team == Client.Team then
  135. local Pos, ScreenCheck = WorldToScreenPoint(p.Character[getgenv().AimPart].Position)
  136. Pos = Vec2(Pos.X, Pos.Y)
  137. local MPos = Vec2(Mouse.X, Mouse.Y) -- Credits to CriShoux for this
  138. local Distance = (Pos - MPos).Magnitude;
  139. if Distance < getgenv().AimRadius then
  140. T = p
  141. end
  142. end
  143. end
  144. end
  145. end
  146. if T then
  147. return T
  148. end
  149. end]]--
  150.  
  151. Uis.InputBegan:Connect(function(Key)
  152. if not (Uis:GetFocusedTextBox()) then
  153. if Key.UserInputType == Enum.UserInputType.MouseButton2 then
  154. pcall(function()
  155. if MousePressed ~= true then MousePressed = true end
  156. local Target;Target = GetNearestTarget()
  157. if Target ~= nil then
  158. AimlockTarget = Target
  159. Notify("Legitinality", "Aimlock Target: "..tostring(AimlockTarget), "", 3)
  160. end
  161. end)
  162. end
  163. if Key.KeyCode == Enum.KeyCode[AimlockToggleKey] then
  164. Aimlock = not Aimlock
  165. Notify("Legitinality", "Aimlock: "..tostring(Aimlock), "", 3)
  166. end
  167. end
  168. end)
  169. Uis.InputEnded:Connect(function(Key)
  170. if not (Uis:GetFocusedTextBox()) then
  171. if Key.UserInputType == Enum.UserInputType.MouseButton2 then
  172. if AimlockTarget ~= nil then AimlockTarget = nil end
  173. if MousePressed ~= false then
  174. MousePressed = false
  175. end
  176. end
  177. end
  178. end)
  179.  
  180. RService.RenderStepped:Connect(function()
  181. if getgenv().FirstPerson == true and getgenv().ThirdPerson == false then
  182. if (Camera.Focus.p - Camera.CoordinateFrame.p).Magnitude <= 1 then
  183. CanNotify = true
  184. else
  185. CanNotify = false
  186. end
  187. elseif getgenv().ThirdPerson == true and getgenv().FirstPerson == false then
  188. if (Camera.Focus.p - Camera.CoordinateFrame.p).Magnitude > 1 then
  189. CanNotify = true
  190. else
  191. CanNotify = false
  192. end
  193. end
  194. if Aimlock == true and MousePressed == true then
  195. if AimlockTarget and AimlockTarget.Character and AimlockTarget.Character:FindFirstChild(getgenv().AimPart) then
  196. if getgenv().FirstPerson == true then
  197. if CanNotify == true then
  198. if getgenv().PredictMovement == true then
  199. Camera.CFrame = CF(Camera.CFrame.p, AimlockTarget.Character[getgenv().AimPart].Position + AimlockTarget.Character[getgenv().AimPart].Velocity/PredictionVelocity)
  200. elseif getgenv().PredictMovement == false then
  201. Camera.CFrame = CF(Camera.CFrame.p, AimlockTarget.Character[getgenv().AimPart].Position)
  202. end
  203. end
  204. elseif getgenv().ThirdPerson == true then
  205. if CanNotify == true then
  206. if getgenv().PredictMovement == true then
  207. Camera.CFrame = CF(Camera.CFrame.p, AimlockTarget.Character[getgenv().AimPart].Position + AimlockTarget.Character[getgenv().AimPart].Velocity/PredictionVelocity)
  208. elseif getgenv().PredictMovement == false then
  209. Camera.CFrame = CF(Camera.CFrame.p, AimlockTarget.Character[getgenv().AimPart].Position)
  210. end
  211. end
  212. end
  213. end
  214. end
  215. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement