Manh01923

Untitled

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