Karap

บราาา

Mar 27th, 2023
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.71 KB | None | 0 0
  1. --// Preventing Multiple Processes
  2.  
  3. pcall(function()
  4. getgenv().Aimbot.Functions:Exit()
  5. end)
  6.  
  7. --// Environment
  8.  
  9. getgenv().Aimbot = {}
  10. local Environment = getgenv().Aimbot
  11.  
  12. --// Services
  13.  
  14. local RunService = game:GetService("RunService")
  15. local UserInputService = game:GetService("UserInputService")
  16. local HttpService = game:GetService("HttpService")
  17. local TweenService = game:GetService("TweenService")
  18. local StarterGui = game:GetService("StarterGui")
  19. local Players = game:GetService("Players")
  20. local Camera = game:GetService("Workspace").CurrentCamera
  21.  
  22. --// Variables
  23.  
  24. local LocalPlayer = Players.LocalPlayer
  25. local Title = "Exunys Developer"
  26. local FileNames = {"Aimbot", "Configuration.json", "Drawing.json"}
  27. local RequiredDistance = math.huge
  28. local Typing = false
  29. local Running = false
  30. local Animation = nil
  31. local ServiceConnections = {RenderSteppedConnection = nil, InputBeganConnection = nil, InputEndedConnection = nil, TypingStartedConnection = nil, TypingEndedConnection = nil}
  32.  
  33. --// Support Functions
  34.  
  35. local mousemoverel = mousemoverel or (Input and Input.MouseMove)
  36. local queueonteleport = syn.queue_on_teleport or queue_on_teleport
  37.  
  38. --// Script Settings
  39.  
  40. Environment.Settings = {
  41. SendNotifications = true,
  42. SaveSettings = true, -- Re-execute upon changing
  43. ReloadOnTeleport = true,
  44. Enabled = true,
  45. TeamCheck = false,
  46. AliveCheck = true,
  47. WallCheck = false, -- Laggy
  48. Sensitivity = 0, -- Animation length (in seconds) before fully locking onto target
  49. ThirdPerson = false, -- Uses mousemoverel instead of CFrame to support locking in third person (could be choppy)
  50. ThirdPersonSensitivity = 3, -- Boundary: 0.1 - 5
  51. TriggerKey = "MouseButton2",
  52. Toggle = false,
  53. LockPart = "Head" -- Body part to lock on
  54. }
  55.  
  56. Environment.FOVSettings = {
  57. Enabled = true,
  58. Visible = true,
  59. Amount = 90,
  60. Color = "255, 255, 255",
  61. LockedColor = "255, 70, 70",
  62. Transparency = 0.5,
  63. Sides = 60,
  64. Thickness = 1,
  65. Filled = false
  66. }
  67.  
  68. Environment.FOVCircle = Drawing.new("Circle")
  69. Environment.Locked = nil
  70.  
  71. --// Core Functions
  72.  
  73. local function Encode(Table)
  74. if Table and type(Table) == "table" then
  75. local EncodedTable = HttpService:JSONEncode(Table)
  76.  
  77. return EncodedTable
  78. end
  79. end
  80.  
  81. local function Decode(String)
  82. if String and type(String) == "string" then
  83. local DecodedTable = HttpService:JSONDecode(String)
  84.  
  85. return DecodedTable
  86. end
  87. end
  88.  
  89. local function GetColor(Color)
  90. local R = tonumber(string.match(Color, "([%d]+)[%s]*,[%s]*[%d]+[%s]*,[%s]*[%d]+"))
  91. local G = tonumber(string.match(Color, "[%d]+[%s]*,[%s]*([%d]+)[%s]*,[%s]*[%d]+"))
  92. local B = tonumber(string.match(Color, "[%d]+[%s]*,[%s]*[%d]+[%s]*,[%s]*([%d]+)"))
  93.  
  94. return Color3.fromRGB(R, G, B)
  95. end
  96.  
  97. local function SendNotification(TitleArg, DescriptionArg, DurationArg)
  98. if Environment.Settings.SendNotifications then
  99. StarterGui:SetCore("SendNotification", {
  100. Title = TitleArg,
  101. Text = DescriptionArg,
  102. Duration = DurationArg
  103. })
  104. end
  105. end
  106.  
  107. --// Functions
  108.  
  109. local function SaveSettings()
  110. if Environment.Settings.SaveSettings then
  111. if isfile(Title.."/"..FileNames[1].."/"..FileNames[2]) then
  112. writefile(Title.."/"..FileNames[1].."/"..FileNames[2], Encode(Environment.Settings))
  113. end
  114.  
  115. if isfile(Title.."/"..FileNames[1].."/"..FileNames[3]) then
  116. writefile(Title.."/"..FileNames[1].."/"..FileNames[3], Encode(Environment.FOVSettings))
  117. end
  118. end
  119. end
  120.  
  121. local function GetClosestPlayer()
  122. if Environment.Locked == nil then
  123. if Environment.FOVSettings.Enabled then
  124. RequiredDistance = Environment.FOVSettings.Amount
  125. else
  126. RequiredDistance = math.huge
  127. end
  128.  
  129. for _, v in next, Players:GetPlayers() do
  130. if v ~= LocalPlayer then
  131. if v.Character and v.Character[Environment.Settings.LockPart] then
  132. if Environment.Settings.TeamCheck and v.Team == LocalPlayer.Team then continue end
  133. if Environment.Settings.AliveCheck and v.Character.Humanoid.Health <= 0 then continue end
  134. if Environment.Settings.WallCheck and #(Camera:GetPartsObscuringTarget({v.Character[Environment.Settings.LockPart].Position}, v.Character:GetDescendants())) > 0 then continue end
  135.  
  136. local Vector, OnScreen = Camera:WorldToViewportPoint(v.Character[Environment.Settings.LockPart].Position)
  137. local Distance = (Vector2.new(UserInputService:GetMouseLocation().X, UserInputService:GetMouseLocation().Y) - Vector2.new(Vector.X, Vector.Y)).Magnitude
  138.  
  139. if Distance < RequiredDistance and OnScreen then
  140. RequiredDistance = Distance
  141. Environment.Locked = v
  142. end
  143. end
  144. end
  145. end
  146. elseif (Vector2.new(UserInputService:GetMouseLocation().X, UserInputService:GetMouseLocation().Y) - Vector2.new(Camera:WorldToViewportPoint(Environment.Locked.Character[Environment.Settings.LockPart].Position).X, Camera:WorldToViewportPoint(Environment.Locked.Character[Environment.Settings.LockPart].Position).Y)).Magnitude > RequiredDistance then
  147. Environment.Locked = nil
  148. Animation:Cancel()
  149. Environment.FOVCircle.Color = GetColor(Environment.FOVSettings.Color)
  150. end
  151. end
  152.  
  153. --// Typing Check
  154.  
  155. ServiceConnections.TypingStartedConnection = UserInputService.TextBoxFocused:Connect(function()
  156. Typing = true
  157. end)
  158.  
  159. ServiceConnections.TypingEndedConnection = UserInputService.TextBoxFocusReleased:Connect(function()
  160. Typing = false
  161. end)
  162.  
  163. --// Create, Save & Load Settings
  164.  
  165. if Environment.Settings.SaveSettings then
  166. if not isfolder(Title) then
  167. makefolder(Title)
  168. end
  169.  
  170. if not isfolder(Title.."/"..FileNames[1]) then
  171. makefolder(Title.."/"..FileNames[1])
  172. end
  173.  
  174. if not isfile(Title.."/"..FileNames[1].."/"..FileNames[2]) then
  175. writefile(Title.."/"..FileNames[1].."/"..FileNames[2], Encode(Environment.Settings))
  176. else
  177. Environment.Settings = Decode(readfile(Title.."/"..FileNames[1].."/"..FileNames[2]))
  178. end
  179.  
  180. if not isfile(Title.."/"..FileNames[1].."/"..FileNames[3]) then
  181. writefile(Title.."/"..FileNames[1].."/"..FileNames[3], Encode(Environment.FOVSettings))
  182. else
  183. Environment.Visuals = Decode(readfile(Title.."/"..FileNames[1].."/"..FileNames[3]))
  184. end
  185.  
  186. coroutine.wrap(function()
  187. while wait(10) do
  188. SaveSettings()
  189. end
  190. end)()
  191. else
  192. if isfolder(Title) then
  193. delfolder(Title)
  194. end
  195. end
  196.  
  197. local function Load()
  198. ServiceConnections.RenderSteppedConnection = RunService.RenderStepped:Connect(function()
  199. if Environment.FOVSettings.Enabled and Environment.Settings.Enabled then
  200. Environment.FOVCircle.Radius = Environment.FOVSettings.Amount
  201. Environment.FOVCircle.Thickness = Environment.FOVSettings.Thickness
  202. Environment.FOVCircle.Filled = Environment.FOVSettings.Filled
  203. Environment.FOVCircle.NumSides = Environment.FOVSettings.Sides
  204. Environment.FOVCircle.Color = GetColor(Environment.FOVSettings.Color)
  205. Environment.FOVCircle.Transparency = Environment.FOVSettings.Transparency
  206. Environment.FOVCircle.Visible = Environment.FOVSettings.Visible
  207. Environment.FOVCircle.Position = Vector2.new(UserInputService:GetMouseLocation().X, UserInputService:GetMouseLocation().Y)
  208. else
  209. Environment.FOVCircle.Visible = false
  210. end
  211.  
  212. if Running and Environment.Settings.Enabled then
  213. GetClosestPlayer()
  214.  
  215. if Environment.Settings.ThirdPerson then
  216. Environment.Settings.ThirdPersonSensitivity = math.clamp(Environment.Settings.ThirdPersonSensitivity, 0.1, 5)
  217.  
  218. local Vector = Camera:WorldToViewportPoint(Environment.Locked.Character[Environment.Settings.LockPart].Position)
  219. mousemoverel((Vector.X - UserInputService:GetMouseLocation().X) * Environment.Settings.ThirdPersonSensitivity, (Vector.Y - UserInputService:GetMouseLocation().Y) * Environment.Settings.ThirdPersonSensitivity)
  220. else
  221. if Environment.Settings.Sensitivity > 0 then
  222. Animation = TweenService:Create(Camera, TweenInfo.new(Environment.Settings.Sensitivity, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {CFrame = CFrame.new(Camera.CFrame.Position, Environment.Locked.Character[Environment.Settings.LockPart].Position)})
  223. Animation:Play()
  224. else
  225. Camera.CFrame = CFrame.new(Camera.CFrame.Position, Environment.Locked.Character[Environment.Settings.LockPart].Position)
  226. end
  227. end
  228.  
  229. Environment.FOVCircle.Color = GetColor(Environment.FOVSettings.LockedColor)
  230. end
  231. end)
  232.  
  233. ServiceConnections.InputBeganConnection = UserInputService.InputBegan:Connect(function(Input)
  234. if not Typing then
  235. pcall(function()
  236. if Input.KeyCode == Enum.KeyCode[Environment.Settings.TriggerKey] then
  237. if Environment.Settings.Toggle then
  238. Running = not Running
  239.  
  240. if not Running then
  241. Environment.Locked = nil
  242. Animation:Cancel()
  243. Environment.FOVCircle.Color = GetColor(Environment.FOVSettings.Color)
  244. end
  245. else
  246. Running = true
  247. end
  248. end
  249. end)
  250.  
  251. pcall(function()
  252. if Input.UserInputType == Enum.UserInputType[Environment.Settings.TriggerKey] then
  253. if Environment.Settings.Toggle then
  254. Running = not Running
  255.  
  256. if not Running then
  257. Environment.Locked = nil
  258. Animation:Cancel()
  259. Environment.FOVCircle.Color = GetColor(Environment.FOVSettings.Color)
  260. end
  261. else
  262. Running = true
  263. end
  264. end
  265. end)
  266. end
  267. end)
  268.  
  269. ServiceConnections.InputEndedConnection = UserInputService.InputEnded:Connect(function(Input)
  270. if not Typing then
  271. pcall(function()
  272. if Input.KeyCode == Enum.KeyCode[Environment.Settings.TriggerKey] then
  273. if not Environment.Settings.Toggle then
  274. Running = false
  275. Environment.Locked = nil
  276. Animation:Cancel()
  277. Environment.FOVCircle.Color = GetColor(Environment.FOVSettings.Color)
  278. end
  279. end
  280. end)
  281.  
  282. pcall(function()
  283. if Input.UserInputType == Enum.UserInputType[Environment.Settings.TriggerKey] then
  284. if not Environment.Settings.Toggle then
  285. Running = false
  286. Environment.Locked = nil
  287. Animation:Cancel()
  288. Environment.FOVCircle.Color = GetColor(Environment.FOVSettings.Color)
  289. end
  290. end
  291. end)
  292. end
  293. end)
  294. end
  295.  
  296. --// Functions
  297.  
  298. Environment.Functions = {}
  299.  
  300. function Environment.Functions:Exit()
  301. SaveSettings()
  302.  
  303. for _, v in next, ServiceConnections do
  304. v:Disconnect()
  305. end
  306.  
  307. Environment.FOVCircle:Remove()
  308.  
  309. getgenv().Aimbot.Functions = nil
  310. getgenv().Aimbot = nil
  311. end
  312.  
  313. function Environment.Functions:Restart()
  314. SaveSettings()
  315.  
  316. for _, v in next, ServiceConnections do
  317. v:Disconnect()
  318. end
  319.  
  320. Environment.FOVCircle:Remove()
  321.  
  322. Load()
  323. end
  324.  
  325. function Environment.Functions:ResetSettings()
  326. Environment.Settings = {
  327. SendNotifications = true,
  328. SaveSettings = true, -- Re-execute upon changing
  329. ReloadOnTeleport = true,
  330. Enabled = true,
  331. TeamCheck = false,
  332. AliveCheck = true,
  333. WallCheck = false,
  334. Sensitivity = 0, -- Animation length (in seconds) before fully locking onto target
  335. ThirdPerson = false,
  336. ThirdPersonSensitivity = 3,
  337. TriggerKey = "MouseButton2",
  338. Toggle = false,
  339. LockPart = "Head" -- Body part to lock on
  340. }
  341.  
  342. Environment.FOVSettings = {
  343. Enabled = true,
  344. Visible = true,
  345. Amount = 90,
  346. Color = "255, 255, 255",
  347. LockedColor = "255, 70, 70",
  348. Transparency = 0.5,
  349. Sides = 60,
  350. Thickness = 1,
  351. Filled = false
  352. }
  353.  
  354. SaveSettings()
  355.  
  356. for _, v in next, ServiceConnections do
  357. v:Disconnect()
  358. end
  359.  
  360. Load()
  361. end
  362.  
  363. --// Support Check
  364.  
  365. if not Drawing or not writefile or not makefolder then
  366. SendNotification(Title, "Your exploit does not support this script", 3); return
  367. end
  368.  
  369. --// Reload On Teleport
  370.  
  371. if Environment.Settings.ReloadOnTeleport then
  372. if queueonteleport then
  373. queueonteleport(game:HttpGet("https://raw.githubusercontent.com/Exunys/Aimbot-V2/main/Resources/Scripts/Main.lua"))
  374. else
  375. SendNotification(Title, "Your exploit does not support \"syn.queue_on_teleport()\"")
  376. end
  377. end
  378.  
  379. --// Load
  380.  
  381. Load(); SendNotification(Title, "Aimbot script successfully loaded! Check the GitHub page on how to configure the script.", 5)
Add Comment
Please, Sign In to add comment