aesnike

OLD(AUTO)

Oct 28th, 2024 (edited)
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.63 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local gui = nil
  3. local mainFrame = nil
  4. local closeButton = nil
  5.  
  6. -- Save file path (relative to the exploit's workspace)
  7. local saveFilePath = "settings.txt"
  8.  
  9. -- Function to load settings from the save file
  10. local function loadSettings()
  11. local success, data = pcall(function()
  12. return game:GetService("HttpService"):JSONDecode(readfile(saveFilePath))
  13. end)
  14. if success then
  15. return data
  16. else
  17. return {}
  18. end
  19. end
  20.  
  21. -- Function to save settings to the save file
  22. local function saveSettings(settings)
  23. local success, _ = pcall(function()
  24. writefile(saveFilePath, game:GetService("HttpService"):JSONEncode(settings))
  25. end)
  26. end
  27.  
  28. -- Function to make an object draggable
  29. local function makeDraggable(object)
  30. local UserInputService = game:GetService("UserInputService")
  31. local dragging
  32. local dragInput
  33. local dragStart
  34. local startPos
  35.  
  36. local function update(input)
  37. local delta = input.Position - dragStart
  38. object.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  39. end
  40.  
  41. object.InputBegan:Connect(function(input)
  42. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  43. dragging = true
  44. dragStart = input.Position
  45. startPos = object.Position
  46.  
  47. input.Changed:Connect(function()
  48. if input.UserInputState == Enum.UserInputState.End then
  49. dragging = false
  50. end
  51. end)
  52. end
  53. end)
  54.  
  55. object.InputChanged:Connect(function(input)
  56. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  57. dragInput = input
  58. end
  59. end)
  60.  
  61. UserInputService.InputChanged:Connect(function(input)
  62. if input == dragInput and dragging then
  63. update(input)
  64. end
  65. end)
  66. end
  67.  
  68. -- Function to create the GUI
  69. local function createGui()
  70. if gui then gui:Destroy() end
  71.  
  72. local ScreenGui = Instance.new("ScreenGui")
  73. local MainFrame = Instance.new("Frame")
  74. local CloseButton = Instance.new("TextButton")
  75.  
  76. ScreenGui.Name = "PersistentGUI"
  77. ScreenGui.ResetOnSpawn = false
  78. ScreenGui.DisplayOrder = 999999999
  79. ScreenGui.Parent = player.PlayerGui
  80.  
  81. CloseButton.Size = UDim2.new(0, 150, 0, 50)
  82. CloseButton.Position = UDim2.new(0.5, -75, 0, 10)
  83. CloseButton.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  84. CloseButton.Text = "Open/Close"
  85. CloseButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  86. CloseButton.Font = Enum.Font.SourceSansBold
  87. CloseButton.TextSize = 18
  88. CloseButton.Parent = ScreenGui
  89. CloseButton.ZIndex = 10
  90.  
  91. local corner = Instance.new("UICorner")
  92. corner.CornerRadius = UDim.new(0.5, 0)
  93. corner.Parent = CloseButton
  94.  
  95. MainFrame.Size = UDim2.new(0.3, 0, 0.5, 0)
  96. MainFrame.Position = UDim2.new(0.5, -150, 0, 80)
  97. MainFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  98. MainFrame.BackgroundTransparency = 0.5
  99. MainFrame.BorderSizePixel = 0
  100. MainFrame.ClipsDescendants = true
  101. MainFrame.Visible = true
  102. MainFrame.ZIndex = 1
  103. MainFrame.Parent = ScreenGui
  104.  
  105. local UIGridLayout = Instance.new("UIGridLayout")
  106. UIGridLayout.Parent = MainFrame
  107. UIGridLayout.CellSize = UDim2.new(0.45, 0, 0, 30)
  108. UIGridLayout.CellPadding = UDim2.new(0.05, 0, 0.05, 0)
  109. UIGridLayout.SortOrder = Enum.SortOrder.LayoutOrder
  110. UIGridLayout.FillDirectionMaxCells = 2
  111.  
  112. local frameCorner = Instance.new("UICorner")
  113. frameCorner.CornerRadius = UDim.new(0.05, 0)
  114. frameCorner.Parent = MainFrame
  115.  
  116. -- Make CloseButton and MainFrame draggable
  117. makeDraggable(CloseButton)
  118. makeDraggable(MainFrame)
  119.  
  120. -- Load saved settings
  121. local savedSettings = loadSettings()
  122.  
  123. -- Function to create toggle buttons
  124. local function createToggleButton(number, name, onClick)
  125. local button = Instance.new("TextButton")
  126. button.Size = UDim2.new(1, 0, 1, 0)
  127. button.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  128. button.Text = name
  129. button.TextColor3 = Color3.fromRGB(255, 255, 255)
  130. button.Font = Enum.Font.SourceSansBold
  131. button.TextSize = 14
  132. button.LayoutOrder = number
  133. button.Parent = MainFrame
  134. button.ZIndex = 2
  135.  
  136. local corner = Instance.new("UICorner")
  137. corner.CornerRadius = UDim.new(0.3, 0)
  138. corner.Parent = button
  139.  
  140. local isEnabled = savedSettings[name] or false
  141. button.BackgroundColor3 = isEnabled and Color3.fromRGB(0, 0, 255) or Color3.fromRGB(0, 0, 0)
  142.  
  143. if isEnabled then
  144. onClick(true)
  145. end
  146.  
  147. button.MouseButton1Click:Connect(function()
  148. isEnabled = not isEnabled
  149. button.BackgroundColor3 = isEnabled and Color3.fromRGB(0, 0, 255) or Color3.fromRGB(0, 0, 0)
  150. savedSettings[name] = isEnabled
  151. saveSettings(savedSettings)
  152. onClick(isEnabled)
  153. end)
  154.  
  155. return button
  156. end
  157.  
  158. -- Kill Aura Function
  159. local killAuraActive = false
  160. local killAuraLoop = nil
  161. local function toggleKillAura(isEnabled)
  162. killAuraActive = isEnabled
  163. if isEnabled then
  164. if not killAuraLoop then
  165. killAuraLoop = spawn(function()
  166. while killAuraActive do
  167. local args = {
  168. [1] = {
  169. [1] = {
  170. ["animationLength"] = 0,
  171. ["sentAt"] = tick()
  172. },
  173. [2] = "G"
  174. }
  175. }
  176. game:GetService("ReplicatedStorage").dataRemoteEvent:FireServer(unpack(args))
  177. wait(0)
  178. end
  179. end)
  180. end
  181. else
  182. killAuraActive = false
  183. killAuraLoop = nil
  184. end
  185. end
  186.  
  187. -- Improved TP Function
  188. local tpActive = false
  189. local tpLoop = nil
  190. local function toggleTP(isEnabled)
  191. tpActive = isEnabled
  192. if isEnabled then
  193. if not tpLoop then
  194. tpLoop = spawn(function()
  195. while tpActive do
  196. local Players = game:GetService("Players")
  197. local LocalPlayer = Players.LocalPlayer
  198. local Character = LocalPlayer.Character
  199.  
  200. local function findNearestNPC()
  201. local nearestNPC = nil
  202. local nearestDistance = math.huge
  203.  
  204. if not Character or not Character:FindFirstChild("HumanoidRootPart") then return end
  205.  
  206. for _, folder in ipairs(workspace:GetChildren()) do
  207. if folder:IsA("Folder") then
  208. for _, child in ipairs(folder:GetChildren()) do
  209. if child:FindFirstChild("enemyFolder") then
  210. for _, npc in ipairs(child.enemyFolder:GetChildren()) do
  211. if npc:FindFirstChild("HumanoidRootPart") and npc:FindFirstChild("Humanoid") and npc.Humanoid.Health > 0 then
  212. local distance = (Character.HumanoidRootPart.Position - npc.HumanoidRootPart.Position).Magnitude
  213. if distance < nearestDistance then
  214. nearestDistance = distance
  215. nearestNPC = npc
  216. end
  217. end
  218. end
  219. end
  220. end
  221. end
  222. end
  223. return nearestNPC
  224. end
  225.  
  226. if Character and Character:FindFirstChild("HumanoidRootPart") then
  227. local targetNPC = findNearestNPC()
  228.  
  229. if targetNPC and targetNPC:FindFirstChild("HumanoidRootPart") then
  230. local npcPosition = targetNPC.HumanoidRootPart.Position
  231. local offset = Vector3.new(0, 9, 0)
  232. local targetPosition = npcPosition + offset
  233.  
  234. local lookAt = CFrame.new(targetPosition, npcPosition)
  235. Character.HumanoidRootPart.CFrame = lookAt
  236. end
  237. end
  238.  
  239. wait(0.1)
  240. end
  241. end)
  242. end
  243. else
  244. tpActive = false
  245. tpLoop = nil
  246. end
  247. end
  248.  
  249. -- Auto-Ability Function
  250. local abilityActive = false
  251. local abilityLoop = nil
  252. local function toggleAbility(isEnabled)
  253. abilityActive = isEnabled
  254. if isEnabled then
  255. if not abilityLoop then
  256. abilityLoop = spawn(function()
  257. local VirtualInputManager = game:GetService("VirtualInputManager")
  258. local lastKeyPress = 0
  259. local keyPressCooldown = 0.5
  260.  
  261. while abilityActive do
  262. local Character = player.Character
  263. if Character and Character:FindFirstChild("HumanoidRootPart") then
  264. local function isNearMobs(range)
  265. for _, folder in ipairs(workspace:GetChildren()) do
  266. if folder:IsA("Folder") then
  267. for _, child in ipairs(folder:GetChildren()) do
  268. if child:FindFirstChild("enemyFolder") then
  269. for _, npc in ipairs(child.enemyFolder:GetChildren()) do
  270. if npc:FindFirstChild("HumanoidRootPart") and npc:FindFirstChild("Humanoid") and npc.Humanoid.Health > 0 then
  271. local distance = (Character.HumanoidRootPart.Position - npc.HumanoidRootPart.Position).Magnitude
  272. if distance <= range then
  273. return true
  274. end
  275. end
  276. end
  277. end
  278. end
  279. end
  280. end
  281. return false
  282. end
  283.  
  284. if isNearMobs(20) and tick() - lastKeyPress >= keyPressCooldown then
  285. VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.E, false, nil)
  286. task.wait()
  287. VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.E, false, nil)
  288.  
  289. VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.Q, false, nil)
  290. task.wait()
  291. VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.Q, false, nil)
  292.  
  293. lastKeyPress = tick()
  294. end
  295. end
  296. wait(0.1)
  297. end
  298. end)
  299. end
  300. else
  301. abilityActive = false
  302. abilityLoop = nil
  303. end
  304. end
  305.  
  306. -- Coin-TP Function
  307. local coinTPActive = false
  308. local coinTPLoop = nil
  309. local function toggleCoinTP(isEnabled)
  310. coinTPActive = isEnabled
  311. if isEnabled then
  312. if not coinTPLoop then
  313. coinTPLoop = spawn(function()
  314. while coinTPActive do
  315. local function waitForCoin()
  316. while not workspace:FindFirstChild("Coin") or not workspace.Coin:FindFirstChild("Coin") do
  317. wait(2)
  318. if not coinTPActive then return nil end
  319. end
  320. return workspace.Coin.Coin
  321. end
  322.  
  323. local coin = waitForCoin()
  324. if coin and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
  325. local offset = Vector3.new(0, 8, 0)
  326. for i = 1, 20 do
  327. if not coinTPActive then break end
  328. player.Character.HumanoidRootPart.CFrame = CFrame.new(coin.Position + offset)
  329. wait(0.01)
  330. end
  331. end
  332. wait(0.1)
  333. end
  334. end)
  335. end
  336. else
  337. coinTPActive = false
  338. coinTPLoop = nil
  339. end
  340. end
  341.  
  342. -- Auto-retry function
  343. local autoRetryActive = false
  344. local function toggleAutoRetry(isEnabled)
  345. autoRetryActive = isEnabled
  346. if isEnabled then
  347. local function checkForEndScreen()
  348. local retryVote = player.PlayerGui:FindFirstChild("RetryVote")
  349. local revivePrompt = player.PlayerGui:FindFirstChild("RevivePrompt")
  350.  
  351. if retryVote and retryVote.Enabled then
  352. wait(1)
  353. local voteArgs = {
  354. [1] = {
  355. [1] = {
  356. ["\3"] = "vote",
  357. ["vote"] = true
  358. },
  359. [2] = "."
  360. }
  361. }
  362. game:GetService("ReplicatedStorage").dataRemoteEvent:FireServer(unpack(voteArgs))
  363. elseif revivePrompt and revivePrompt.Enabled then
  364. wait(1)
  365. local reviveArgs = {
  366. [1] = {
  367. [1] = {
  368. ["\3"] = "closeRevive"
  369. },
  370. [2] = "\13"
  371. }
  372. }
  373. game:GetService("ReplicatedStorage").dataRemoteEvent:FireServer(unpack(reviveArgs))
  374. end
  375. end
  376.  
  377. player.PlayerGui.ChildAdded:Connect(function(child)
  378. if autoRetryActive and (child.Name == "RetryVote" or child.Name == "RevivePrompt") then
  379. checkForEndScreen()
  380. end
  381. end)
  382.  
  383. checkForEndScreen()
  384. end
  385. end
  386.  
  387. -- Auto-Play Function
  388. local function toggleAutoPlay(isEnabled)
  389. if isEnabled then
  390. local function autoPlay()
  391. wait(4)
  392. local args = {
  393. [1] = {
  394. [1] = {
  395. [1] = "\1"
  396. },
  397. [2] = "2"
  398. }
  399. }
  400. game:GetService("ReplicatedStorage").dataRemoteEvent:FireServer(unpack(args))
  401. end
  402.  
  403. if game.Players.LocalPlayer.Character then
  404. autoPlay()
  405. end
  406. game.Players.LocalPlayer.CharacterAdded:Connect(autoPlay)
  407. else
  408. for _, connection in pairs(getconnections(game.Players.LocalPlayer.CharacterAdded)) do
  409. if connection.Function and tostring(connection.Function):find("autoPlay") then
  410. connection:Disconnect()
  411. end
  412. end
  413. end
  414. end
  415.  
  416. -- Auto-Character Function
  417. local function toggleAutoCharacter(isEnabled)
  418. if isEnabled then
  419. local function autoCharacter()
  420. wait(7)
  421. local args = {
  422. [1] = {
  423. [1] = {
  424. [1] = "\1",
  425. [2] = {
  426. ["\3"] = "select",
  427. ["charact"] = 1
  428. }
  429. },
  430. [2] = "2"
  431. }
  432. }
  433. game:GetService("ReplicatedStorage").dataRemoteEvent:FireServer(unpack(args))
  434. end
  435.  
  436. if game.Players.LocalPlayer.Character then
  437. autoCharacter()
  438. end
  439. game.Players.LocalPlayer.CharacterAdded:Connect(autoCharacter)
  440. else
  441. for _, connection in pairs(getconnections(game.Players.LocalPlayer.CharacterAdded)) do
  442. if connection.Function and tostring(connection.Function):find("autoCharacter") then
  443. connection:Disconnect()
  444. end
  445. end
  446. end
  447. end
  448.  
  449. -- Create toggle buttons
  450. createToggleButton(1, "Kill Aura", toggleKillAura)
  451. createToggleButton(2, "TP", toggleTP)
  452. createToggleButton(3, "Auto Ability", toggleAbility)
  453. createToggleButton(4, "Coin TP", toggleCoinTP)
  454. createToggleButton(5, "Auto Retry", toggleAutoRetry)
  455. createToggleButton(6, "Auto Play", toggleAutoPlay)
  456. createToggleButton(7, "Auto Character", toggleAutoCharacter)
  457.  
  458. -- Toggle GUI visibility
  459. CloseButton.MouseButton1Click:Connect(function()
  460. MainFrame.Visible = not MainFrame.Visible
  461. CloseButton.Text = MainFrame.Visible and "Close" or "Open"
  462. end)
  463.  
  464. gui = ScreenGui
  465. mainFrame = MainFrame
  466. closeButton = CloseButton
  467. end
  468.  
  469. -- Create the initial GUI
  470. createGui()
  471.  
  472. -- Recreate GUI when player rejoins
  473. game.Players.PlayerRemoving:Connect(function(plr)
  474. if plr == player then
  475. saveSettings(loadSettings())
  476. end
  477. end)
  478.  
  479. game.Players.PlayerAdded:Connect(function(plr)
  480. if plr == player then
  481. wait(1)
  482. createGui()
  483. end
  484. end)
Add Comment
Please, Sign In to add comment