Qamyz

Untitled

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