Migas3456

aimbot

Dec 26th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.85 KB | None | 0 0
  1. -- @Lilith.lua
  2. -- author: lenny
  3. local f_print, printing = print, true
  4. local function print ( ... )
  5. if printing then
  6. f_print("[Lilith] - ", ...)
  7. end
  8. end
  9. print "Version 1.4b, official release;"
  10. print "Aimbot will not work in every game, such as Phantom Forces."
  11.  
  12. -- configuration:
  13. local settings = {
  14. -- hotkeys:
  15. commandbar_Hotkey = "Minus",
  16. esp_Hotkey = "RightAlt",
  17. aimbot_Hotkey = "RightControl";
  18.  
  19. -- defaults:
  20. esp_boxColor = "Bright red",
  21. esp_boxTransparent = true,
  22. esp_useTeamColorIfApplicable = true,
  23. esp_showDistance = true,
  24. esp_holdHotkey = false,
  25. esp_showCharacterEspd = true,
  26. aimbot_clickToLock = true,
  27. aimbot_clickToLockDistanceOverride = true,
  28. aimbot_maxDistance = 250,
  29. aimbot_aimFor = "Head";
  30.  
  31. -- ignores:
  32. esp_ignoreTeam = true,
  33. esp_dont_ignoreSelf = false,
  34. aimbot_ignoreWalls = false,
  35. aimbot_ignoreTeam = false;
  36. }
  37.  
  38. -- mainscript:
  39. local Players = game:GetService("Players")
  40. local Teams = game:GetService("Teams")
  41. local RunService = game:GetService("RunService")
  42. local UserInputService = game:GetService("UserInputService")
  43.  
  44. local localPlayer = Players.LocalPlayer
  45. local Mouse = localPlayer:GetMouse()
  46. local CoreGui = game:GetService("CoreGui")
  47.  
  48. local function findFirstChild (obj, name, sensitive)
  49. local children = obj:GetChildren()
  50. for i = 1, #children do
  51. local objN = children[i].Name
  52. if not sensitive then
  53. objN, name = objN:lower(), name:lower()
  54. end
  55. if objN:sub(1, name:len()) == name then
  56. return children[i]
  57. end
  58. end
  59. end
  60. local function setHotkey (section, keyName)
  61. if Enum.KeyCode[keyName] then
  62. settings[section .. '_Hotkey'] = Enum.KeyCode[keyName]
  63. print ("Sucessfully set " .. section .. "'s hotkey to " .. keyName)
  64. end
  65. end setHotkey("esp", settings.esp_Hotkey); setHotkey("aimbot", settings.aimbot_Hotkey); setHotkey("commandbar", settings.commandbar_Hotkey)
  66. local function splitString (str, delimeter)
  67. local strParts = {}
  68. local pattern = ("([^%s]+)"):format(delimeter)
  69.  
  70. str:gsub(pattern, function(section)
  71. strParts[#strParts + 1] = section
  72. end)
  73. return strParts
  74. end
  75. local function isHumanoidAlive (character)
  76. if character then
  77. local humanoid = character:FindFirstChildOfClass("Humanoid")
  78. if humanoid and humanoid.Health > 0 then
  79. return character, humanoid
  80. end
  81. end
  82. end
  83. local function getCharacterFromPart (obj) -- made this in haste, so its unorganized!
  84. while (obj ~= game and obj ~= workspace) and (obj.Parent and not Players:GetPlayerFromCharacter(obj.Parent)) do
  85. obj = obj.Parent
  86. end
  87. return obj
  88. end
  89. local function viewNotObstructed (lookingAt, parent)
  90. local character, _ = isHumanoidAlive(localPlayer.Character)
  91. if character then
  92. local headPos = character.Head.CFrame.p
  93. local viewRay = Ray.new(headPos, (lookingAt.CFrame.p - headPos).unit *
  94. settings.aimbot_maxDistance)
  95. local object = workspace:FindPartOnRay(viewRay, character, true, true)
  96. if object then
  97. return object:IsDescendantOf(parent)
  98. end
  99. end
  100. end
  101. local function setColor (color)
  102. return select(2, pcall(function()
  103. if typeof(color) == "BrickColor" then
  104. color = color.Color
  105. elseif typeof(color) == "string" then
  106. color = BrickColor.new(color).Color
  107. end
  108. return color
  109. end))
  110. end
  111.  
  112. -- @create objects
  113. local ESPOBJF do
  114. ESPOBJF = findFirstChild(CoreGui, "ESPOBJF")
  115. if not ESPOBJF then
  116. ESPOBJF = Instance.new("Folder", CoreGui)
  117. ESPOBJF.Name = "ESPOBJF"
  118. end
  119. end
  120. local Box, espText, aimbotText
  121. local commandBar do
  122. commandBar = Instance.new("ScreenGui")
  123. commandBar.Name = "%$#@$!&"
  124.  
  125. local frame = Instance.new("Frame", commandBar)
  126. frame.BackgroundTransparency = 1; frame.Size, frame.Position = UDim2.new(0.221, 0,0.111, 0), UDim2.new(0.407, 0,0.644, 0); frame.Draggable = true; frame.Active = true
  127.  
  128. local textlabel = Instance.new("TextLabel", frame)
  129. textlabel.BackgroundTransparency = 1; textlabel.TextSize = 16; textlabel.TextColor3 = Color3.fromRGB(255, 255, 255); textlabel.Font = Enum.Font.SourceSansLight; textlabel.Position, textlabel.Size = UDim2.new(0.132, 0,0.1, 0), UDim2.new(0.75, 0, 0.201, 0); textlabel.ZIndex = 1; textlabel.Text = "[Lilith]"
  130.  
  131. Box = Instance.new("TextBox", frame)
  132. Box.BackgroundColor3 = Color3.fromRGB(58, 58, 58); Box.BackgroundTransparency = 0.5; Box.BorderSizePixel = 0; Box.TextSize = 16; Box.TextColor3 = Color3.fromRGB(255, 255, 255); Box.Font = Enum.Font.SourceSansItalic; Box.ClipsDescendants = true; Box.ZIndex = 1; Box.Text = "press to `-` to type"; Box.Size, Box.Position = UDim2.new(0.922, 0,0.402, 0), UDim2.new(0.026, 0,0.402, 0) ; Box.TextTransparency = 0.5
  133.  
  134. aimbotText = textlabel:Clone()
  135. aimbotText.Size, aimbotText.Position =UDim2.new(0.079, 0,0.201, 0), UDim2.new(0.74, 0,0.1, 0); aimbotText.TextColor3, aimbotText.Font = Color3.fromRGB(48, 48, 48), Enum.Font.SourceSansBold; aimbotText.Text = "bot"; aimbotText.Parent = frame
  136.  
  137. espText = textlabel:Clone()
  138. espText.Size, espText.Position =UDim2.new(0.079, 0,0.201, 0), UDim2.new(0.184, 0,0.1, 0); espText.TextColor3, espText.Font = Color3.fromRGB(48, 48, 48), Enum.Font.SourceSansBold; espText.Text = "esp"; espText.Parent = frame
  139. end
  140. local active_espObjects = {}
  141. local function clear_active_espObjects (ofParent)
  142. if not ofParent then
  143. ESPOBJF:ClearAllChildren()
  144. local a = 1
  145. while active_espObjects[a] do
  146. if active_espObjects[a] then
  147. active_espObjects[a]:Destroy()
  148. end
  149. active_espObjects[a] = nil
  150. a = a + 1
  151. end
  152. else
  153. local j = 1
  154. while active_espObjects[j] do
  155. local espObj = active_espObjects[j]
  156. if espObj and espObj:IsDescendantOf(ofParent) or ((espObj:IsA("BoxHandleAdornment") or espObj:IsA("BillboardGui")) and espObj.Adornee and espObj.Adornee:IsDescendantOf(ofParent)) then
  157. espObj:Destroy()
  158. espObj = nil
  159. end
  160. j = j + 1
  161. end
  162. end
  163. end
  164. local function createEspBoxOnObj (obj, color)
  165. local espBox do
  166. espBox = Instance.new("BoxHandleAdornment")
  167. espBox.AlwaysOnTop = true
  168. espBox.ZIndex = 10
  169. espBox.Color3 = BrickColor.new(settings.esp_boxColor).Color
  170. end
  171.  
  172. local color = setColor(color)
  173. if color then
  174. espBox.Color3 = color
  175. end
  176.  
  177. if settings.esp_boxTransparent then
  178. espBox.Transparency = 0.8
  179. end
  180.  
  181. espBox.Size = obj.Size
  182. espBox.Adornee = obj
  183. espBox.Parent = ESPOBJF
  184. active_espObjects[#active_espObjects + 1] = espBox
  185.  
  186. return espBox
  187. end
  188. local function getDistanceFrom (object)
  189. if localPlayer.Character and localPlayer.Character.Head then
  190. return math.floor((object.Position - localPlayer.Character.Head.Position).magnitude)
  191. else
  192. return "err"
  193. end
  194. end
  195. local function createDistTagOnCharacter (character, removeTag, color)
  196. local _, humanoid = isHumanoidAlive(character)
  197. if humanoid then
  198. humanoid.Died:Connect(function()
  199. clear_active_espObjects(character)
  200. end)
  201. local head = character:FindFirstChild("Head")
  202. if head then
  203. if ESPOBJF:findFirstChild(character.Name) then
  204. ESPOBJF[character.Name]:Destroy()
  205. if removeTag then
  206. return
  207. end
  208. end
  209.  
  210. local textLabel
  211. local distTag do
  212. distTag = Instance.new("BillboardGui")
  213. distTag.AlwaysOnTop = true
  214. distTag.Enabled = true
  215. distTag.Size = UDim2.new(0, 10,0, 50)
  216.  
  217. textLabel = Instance.new("TextLabel", distTag)
  218. textLabel.Size = UDim2.new(0, 75,0, 25)
  219. textLabel.BackgroundColor3 = (color ~= nil and color) or Color3.fromRGB(48, 48, 48)
  220. textLabel.BackgroundTransparency = 0.5
  221. textLabel.Font = Enum.Font.SourceSansBold
  222. textLabel.TextSize = 18
  223. textLabel.TextColor3 = Color3.fromRGB(255, 255 ,255)
  224. textLabel.ClipsDescendants = true
  225. textLabel.BorderSizePixel = 0
  226. end
  227. distTag.Adornee = head
  228. distTag.Parent = ESPOBJF
  229. distTag.Name = character.Name
  230. textLabel.Text = character.Name
  231. active_espObjects[#active_espObjects + 1] = distTag
  232.  
  233. coroutine.resume(coroutine.create(function()
  234. local now = tick()
  235. while isHumanoidAlive(character) and distTag do
  236. local t = tick() - now
  237. if t < 5 then
  238. if textLabel.Text ~= character.Name then
  239. textLabel.Text = character.Name
  240. end
  241. elseif t < 10 and t > 5 then
  242. textLabel.Text = getDistanceFrom(head)
  243. elseif t > 10 then
  244. now = tick()
  245. end
  246. wait()
  247. end
  248. end))
  249. return distTag
  250. end
  251. end
  252. end
  253.  
  254. -- @esp component
  255. local function esp_getPlayers ()
  256. local players = {}
  257. for _, player in next, Players:GetPlayers() do
  258. if (not settings.esp_ignoreTeam and player.Team ~= localPlayer.Team) or settings.esp_ignoreTeam then
  259. if settings.esp_dont_ignoreSelf or player ~= localPlayer then
  260. players[#players + 1] = player
  261. end
  262. end
  263. end
  264. return players
  265. end
  266. function espCharacter (character, color, override)
  267. local alreadyESPdTag = character:FindFirstChild("AESPT")
  268. if alreadyESPdTag then
  269. if override then
  270. clear_active_espObjects(character)
  271. else
  272. return
  273. end
  274. end
  275.  
  276. local _, humanoid = isHumanoidAlive(character)
  277. if humanoid then
  278.  
  279. humanoid.Died:Connect(function()
  280. clear_active_espObjects(character)
  281. end)
  282. for _, part in next, character:GetChildren() do
  283. if part:IsA("BasePart") then
  284. createEspBoxOnObj(part, color)
  285. end
  286. end
  287.  
  288. alreadyESPdTag = Instance.new("BoolValue", character)
  289. alreadyESPdTag.Name = "AESPT"
  290. active_espObjects[#active_espObjects + 1] = alreadyESPdTag
  291. end
  292. end
  293. local espEnabled = false
  294. local esp_Cache = {}
  295. function clear_esp_Cache ()
  296. local a = 1
  297. while esp_Cache[a] do
  298. esp_Cache[a]:Disconnect()
  299. esp_Cache[a] = nil
  300. a = a + 1
  301. end
  302. esp_Cache = {}
  303. end
  304. local function handle_Esp (character)
  305.  
  306. local timeout = tick()
  307. if not isHumanoidAlive(character) then
  308. repeat wait() until isHumanoidAlive(character) or (tick() - timeout) >= 2
  309. if not isHumanoidAlive(character) then return end
  310. end
  311.  
  312. local teamColor = Players:GetPlayerFromCharacter(character).TeamColor
  313. local color = (settings.esp_useTeamColorIfApplicable and teamColor) or settings.esp_boxColor
  314. color = setColor(color)
  315. if settings.esp_showCharacterEspd then
  316. espCharacter(character, color)
  317. end
  318. if settings.esp_showDistance then
  319. createDistTagOnCharacter(character, false, color)
  320. end
  321.  
  322. local humanoid = character:FindFirstChildOfClass("Humanoid")
  323. humanoid.Died:Connect(function()
  324. clear_active_espObjects(character)
  325. end)
  326.  
  327. end
  328. local function toggle_Esp (turnOff)
  329. if turnOff then
  330. clear_esp_Cache()
  331. clear_active_espObjects()
  332. espEnabled = false
  333. espText.TextColor3 = Color3.fromRGB(48, 48, 48)
  334. print "ESP successfully disabled"
  335. return
  336. elseif not turnOff and not espEnabled then
  337. print "Attempting to enabled ESP .."
  338. clear_esp_Cache()
  339. clear_active_espObjects()
  340. local players = esp_getPlayers()
  341. for _, player in next, players do
  342. local rbxScriptSignal = player.CharacterAdded:Connect(function(character)
  343. if (not espEnabled and rbxScriptSignal) then rbxScriptSignal:Disconnect(); rbxScriptSignal = nil return end
  344. handle_Esp(character)
  345. end); esp_Cache[#esp_Cache + 1] = rbxScriptSignal
  346. if player.Character and isHumanoidAlive(player.Character) then
  347. handle_Esp(player.Character)
  348. end
  349. end
  350. espText.TextColor3 = Color3.fromRGB(0, 255, 0)
  351. print "ESP successfully enabled"
  352. end
  353. end
  354.  
  355. -- @aimbot component
  356. local targetPlayer, targetTeam, currentLock
  357. local function clickToTarget (target, override_maxDistance)
  358. if target and (override_maxDistance or (not override_maxDistance and getDistanceFrom(target) <= settings.aimbot_maxDistance)) then
  359. if target.Parent and isHumanoidAlive(target.Parent) then
  360. targetPlayer = game.Players:GetPlayerFromCharacter(target.Parent)
  361. return true
  362. end
  363. end
  364. end
  365. local function getClosestCharacter ()
  366. if isHumanoidAlive(localPlayer.Character) then
  367. local closestDist, chrctr
  368. if targetPlayer then
  369. chrctr, _ = isHumanoidAlive(targetPlayer.Character)
  370. if not chrctr then
  371. chrctr = targetPlayer.CharacterAdded:wait()
  372. end
  373. else
  374. local players = (targetTeam and targetTeam:GetPlayers()) or Players:GetPlayers()
  375. for i = 1, #players do
  376. if players[i] ~= localPlayer and (targetTeam or settings.aimbot_ignoreTeam or (not settings.aimbot_ignoreTeam and players[i].Team ~= localPlayer.Team)) then
  377. local player = players[i]
  378. if isHumanoidAlive(player.Character) then
  379. local bodyPart = player.Character:FindFirstChild(settings.aimbot_aimFor)
  380. if bodyPart then
  381. local distanceBetween = getDistanceFrom(bodyPart)
  382. if distanceBetween <= settings.aimbot_maxDistance and (not closestDist or distanceBetween < closestDist) then
  383. if (settings.aimbot_ignoreWalls or (not settings.aimbot_ignoreWalls and viewNotObstructed(bodyPart, player.Character))) then
  384. closestDist = distanceBetween
  385. chrctr = player.character
  386. end
  387. end
  388. end
  389. end
  390. end
  391. end
  392. end
  393. return chrctr
  394. end
  395. end
  396. local function targetCamera ()
  397. if isHumanoidAlive(localPlayer.Character) then
  398. local head = localPlayer.Character.Head
  399. local camera = workspace.CurrentCamera
  400. local character = (targetPlayer and isHumanoidAlive(targetPlayer.Character) and targetPlayer.Character) or getClosestCharacter()
  401. if character and character:FindFirstChild(settings.aimbot_aimFor) then
  402. currentLock = Players:GetPlayerFromCharacter(character)
  403. camera.CFrame = CFrame.new(camera.CFrame.p, character[settings.aimbot_aimFor].CFrame.p)
  404. end
  405. end
  406. end
  407. aimbotEnabled = false
  408. local function toggle_Aimbot ()
  409. aimbotEnabled = not aimbotEnabled
  410. print ("Aimbot successfully " .. ((aimbotEnabled and "enabled") or "disabled"))
  411. aimbotText.TextColor3 = (aimbotEnabled and Color3.fromRGB(0, 255, 0)) or Color3.fromRGB(48, 48, 48)
  412. end
  413.  
  414. -- @commandbar component
  415. local function isSetting (settingName)
  416. for k in next, settings do
  417. if k:lower() == settingName:lower() then
  418. return k
  419. end
  420. end
  421. return nil
  422. end
  423. local function changeSetting (settingName, newValue, notBoolean)
  424. if typeof(newValue) == "string" and not notBoolean then
  425. if (newValue:lower() == "enable" or newValue:lower() == "true") then newValue = true
  426. elseif (newValue:lower() == "disable" or newValue:lower() == "false") then newValue = false end
  427. end
  428. local k = isSetting(settingName)
  429. if k then
  430. settings[k] = newValue
  431. print("changed", k, newValue)
  432. end
  433. end
  434. function execute_Command (contents)
  435. local section = contents[1]:lower()
  436. local command = contents[2] and contents[2]:lower()
  437.  
  438. if (section == "enable" or section == "on") or (section == "disable" or section == "off") then
  439. if command == "aimbot" then
  440. aimbotEnabled = (section == "enable" or section == "on")
  441. print ("Aimbot successfully " .. ((aimbotEnabled and "enabled") or "disabled"))
  442. aimbotText.TextColor3 = (aimbotEnabled and Color3.fromRGB(0, 255, 0)) or Color3.fromRGB(48, 48, 48)
  443. elseif command == "esp" then
  444. toggle_Esp((section == "disable" or section == "off") and true)
  445. espEnabled = (section == "enable" or section == "on")
  446. end
  447.  
  448. --
  449.  
  450. elseif section == "esp" then
  451. if (command == "enable" or command == "on") or (command == "disable" or command == "off") then
  452. toggle_Esp((command == "disable" or command == "off") and true)
  453. espEnabled = (command == "enable" or command == "on")
  454. elseif command == "find" or command == "hide" or command:find("dist") then
  455. local plyr = findFirstChild(Players, contents[3]:lower())
  456. local color = (#contents > 4 and table.concat(contents, " ", 4)) or contents[4]
  457. if color == "" or color == " " then
  458. color = nil
  459. end
  460. if plyr then
  461. if command == "showdist" or command == "hidedist" then
  462. createDistTagOnCharacter(plyr.Character, command == "hidedist", color)
  463. return
  464. else
  465. if command == "find" then
  466. espCharacter(plyr.Character, color, true)
  467. espEnabled = true
  468. espText.TextColor3 = Color3.fromRGB(0, 255, 0)
  469. elseif command == "hide" then
  470. clear_active_espObjects(plyr.Character)
  471. end
  472. end
  473. end
  474. elseif command == "boxcolor" then
  475. local color = (#contents > 3 and table.concat(contents, " ", 3)) or contents[3]
  476. if color ~= " " and color ~= "" then
  477. changeSetting("esp_boxColor", color)
  478. toggle_Esp(true); toggle_Esp()
  479. print "Esp reset due to setting change."
  480. end
  481. elseif command == "ignoreteam" or command == "dontignoreself" or command == "showdistance" or command == "showcharacterespd" or command == "holdhotkey" or command == "useteamcolorifapplicable" or command == "boxtransparent" then
  482.  
  483. local value = contents[3]:lower()
  484. if command ~= "holdhotkey" then
  485. if command == "ignoreteam" then
  486. changeSetting("esp_ignoreTeam", value)
  487. elseif command == "dontignoreself" then
  488. changeSetting("esp_dont_ignoreSelf", value)
  489. elseif command == "showdistance" then
  490. changeSetting("esp_showDistance", value)
  491. elseif command == "boxtransparent" then
  492. changeSetting("esp_boxTransparent", value)
  493. elseif command == "showcharacterespd" then
  494. changeSetting("esp_showCharacterEspd", value)
  495. elseif command == "useteamcolorifapplicable" then
  496. changeSetting("esp_useTeamColorIfApplicable", value)
  497. end
  498. toggle_Esp(true); toggle_Esp()
  499. print "Esp reset due to setting change."
  500. else
  501. changeSetting("esp_holdHotkey", value)
  502. if settings.esp_holdHotkey then
  503. print "Esp must now be activated by holding the hotkey."
  504. else
  505. print "Esp must now be toggled by pressing the hotkey."
  506. end
  507. toggle_Esp(true)
  508. print "Esp turned off due to activation change."
  509. end
  510. elseif command == "hotkey" or command == "sethotkey" then
  511. setHotkey("esp", contents[3])
  512. toggle_Esp(true)
  513. print "Esp turned off due to activation change."
  514. end
  515.  
  516. --
  517.  
  518. elseif section == "aimbot" then
  519. if (command == "enable" or command == "on") or (command == "disable" or command == "off") then
  520. aimbotEnabled = (command == "enable" or command == "on")
  521. aimbotText.TextColor3 = (aimbotEnabled and Color3.fromRGB(0, 255, 0)) or Color3.fromRGB(48, 48, 48)
  522. print ("Aimbot successfully " .. ((aimbotEnabled and "enabled") or "disabled"))
  523. elseif command == "target" then
  524. local content3 = contents[3]:lower()
  525. local plyr = findFirstChild(Players, content3)
  526. if not plyr then
  527. if content3 == "team" then
  528. local content4 = (#contents > 4 and table.concat(contents, " ", 4)) or contents[4]
  529. local team = findFirstChild(Teams, content4)
  530. if not team and (content4 == "disable" or content4 == "__disable") then
  531. targetTeam = nil
  532. aimbotEnabled = false
  533. aimbotText.TextColor3 = Color3.fromRGB(48, 48, 48)
  534. print "Aimbot disabled; target team removed."
  535. else
  536. targetTeam = team
  537. if aimbotEnabled then
  538. aimbotEnabled = false
  539. end
  540. aimbotEnabled = true
  541. aimbotText.TextColor3 = Color3.fromRGB(0, 255, 0)
  542. print "Aimbot enabled; target team set."
  543. end
  544. elseif content3 == "disable" or content3 == "__disable" then
  545. targetPlayer = nil
  546. aimbotEnabled = false
  547. aimbotText.TextColor3 = Color3.fromRGB(48, 48, 48)
  548. print "Aimbot disabled; target player removed."
  549. end
  550. else
  551. targetPlayer = plyr
  552. if aimbotEnabled then
  553. aimbotEnabled = false
  554. end
  555. aimbotEnabled = true
  556. aimbotText.TextColor3 = Color3.fromRGB(0, 255, 0)
  557. print "Aimbot target enabled; player set."
  558. end
  559. else
  560. if command == "maxdistance" then
  561. local number = tonumber(contents[3])
  562. if number then
  563. changeSetting("aimbot_maxDistance", number)
  564. end
  565.  
  566. elseif (command == "ignorewalls" or command == "ignoreteam" or command == "aimfor" or command == "clicktolock" or command == "clicktolockdistanceoverride") then
  567. local value = contents[3]
  568. if command == "ignorewalls" then
  569. changeSetting("aimbot_ignoreWalls", value)
  570. elseif command == "ignoreteam" then
  571. changeSetting("aimbot_ignoreTeam", value)
  572. elseif command == "clicktolock" then
  573. changeSetting("aimbot_clickToLock", value)
  574. elseif command == "clicktolockdistanceoverride" then
  575. changeSetting("aimbot_clickToLockDistanceOverride", value)
  576. elseif command == "aimfor" then
  577. changeSetting("aimbot_aimFor", (#contents > 3 and table.concat(contents, " ", 3) or contents[3]), true)
  578. end
  579. aimbotEnabled = false; aimbotEnabled = "true"
  580. aimbotText.TextColor3 = Color3.fromRGB(0, 255, 0)
  581. print "Aimbot reset due to setting change."
  582.  
  583. elseif command == "hotkey" or command == "sethotkey" then
  584. setHotkey("aimbot", contents[3])
  585. aimbotEnabled = false
  586. aimbotText.TextColor3 = Color3.fromRGB(48, 48, 48)
  587. print "Aimbot turned off due to activation change."
  588. end
  589. end
  590.  
  591.  
  592. -- @some flexiblity
  593. elseif section == "target" then
  594. execute_Command({"aimbot", "target", contents[2], contents[3]})
  595. elseif (section == "find" or section == "hide" or section:find("dist")) then
  596. execute_Command({"esp", section, contents[2], (#contents > 3 and table.concat(contents, " ", 3) or contents[3])})
  597.  
  598.  
  599. -- @basic fix
  600. elseif section == "resetcache" then
  601. clear_active_espObjects()
  602. elseif section == "terminate" then
  603. ESP_RBXScriptSignal:Disconnect()
  604. ESP_RBXScriptSignal = nil
  605. AIMBOT_RbxScriptSignal:Disconnect()
  606. AIMBOT_RbxScriptSignal = nil
  607. KEYS_RbxScriptSignal:Disconnect()
  608. KEYS_RbxScriptSignal = nil
  609.  
  610. clear_esp_Cache()
  611. clear_active_espObjects()
  612. ESPOBJF:Destroy()
  613. commandBar:Destroy()
  614.  
  615. end
  616. end
  617. local function on_FocusLost (enterPressed)
  618. local content = Box.Text
  619. Box.Text = "press `-` to type"
  620. Box.Font = Enum.Font.SourceSansItalic
  621. Box.TextTransparency = 0.5
  622. if enterPressed then
  623. if content ~= " " or content ~= "" then
  624. execute_Command(splitString(content, " "))
  625. end
  626. end
  627. end
  628.  
  629. -- @endscript
  630. ESP_RBXScriptSignal = RunService.RenderStepped:Connect(function()
  631. if not script then
  632. return
  633. end
  634. if not settings.esp_holdHotkey then
  635. return
  636. end
  637. if not espEnabled and UserInputService:IsKeyDown(settings.esp_Hotkey) then
  638. toggle_Esp()
  639. espEnabled = true
  640. elseif espEnabled and not UserInputService:IsKeyDown(settings.esp_Hotkey) then
  641. toggle_Esp(true)
  642. end
  643. end)
  644. AIMBOT_RbxScriptSignal = RunService.RenderStepped:Connect(function()
  645. if aimbotEnabled then
  646. targetCamera()
  647. end
  648. end)
  649. KEYS_RbxScriptSignal = UserInputService.InputBegan:Connect(function(inputObj, gpe)
  650. local key = inputObj.KeyCode
  651. if (key == settings.esp_Hotkey) or (key == settings.aimbot_Hotkey) or (key == settings.commandbar_Hotkey) then
  652. if key == settings.commandbar_Hotkey and not gpe then
  653. Box:CaptureFocus()
  654. end
  655. if key == settings.aimbot_Hotkey then
  656. toggle_Aimbot()
  657. end
  658. if key == settings.esp_Hotkey then
  659. if espEnabled then
  660. toggle_Esp(true)
  661. else
  662. toggle_Esp()
  663. espEnabled = true
  664. end
  665. end
  666. end
  667. end)
  668. AIMBOTLOCK_RbxScriptSignal = Mouse.Button2Down:Connect(function()
  669.  
  670. local t = Mouse.Target
  671. if not t then
  672. return
  673. end
  674. if not Players:GetPlayerFromCharacter(t.Parent) then
  675. local character = getCharacterFromPart(t)
  676. if not character then
  677. return
  678. else
  679. t = character:FindFirstChild("HumanoidRootPart")
  680. if not t then
  681. return
  682. end
  683. end
  684. end
  685.  
  686. if not aimbotEnabled and settings.aimbot_clickToLock then
  687. local success = clickToTarget(t, settings.aimbot_clickToLockDistanceOverride)
  688. if success then
  689. currentLock = targetPlayer
  690. aimbotEnabled = true
  691. aimbotText.TextColor3 = Color3.fromRGB(0, 255, 0)
  692. print "Aimbot Enabled; target player set. [click to lock method]"
  693. end
  694. elseif aimbotEnabled then
  695. if currentLock and currentLock.Character and t:IsDescendantOf(currentLock.Character) then
  696. if targetPlayer ~= currentLock then
  697. targetPlayer = currentLock
  698. elseif targetPlayer == currentLock then
  699. targetPlayer, currentLock = nil, nil
  700. aimbotEnabled = false
  701. aimbotText.TextColor3 = Color3.fromRGB(48, 48, 48)
  702. print "Aimbot disabled; target player removed. [click to lock method]"
  703. end
  704. end
  705. end
  706.  
  707. end)
  708. Box.FocusLost:Connect(on_FocusLost)
  709. Box.Focused:Connect(function()
  710. Box.Font = Enum.Font.SourceSans
  711. Box.TextTransparency = 0
  712. end)
  713.  
  714. ESPOBJF.Parent = CoreGui
  715. commandBar.Parent = CoreGui
Add Comment
Please, Sign In to add comment