zumhad

Untitled

May 7th, 2025 (edited)
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 14.96 KB | None | 0 0
  1. local UserInputService = game:GetService("UserInputService")
  2. local Players = game:GetService("Players")
  3. local RunService = game:GetService("RunService")
  4. local LocalPlayer = Players.LocalPlayer
  5.  
  6. -- Ждём загрузки персонажа
  7. local function waitForCharacter()
  8.     while not LocalPlayer.Character or not LocalPlayer.Character:FindFirstChild("HumanoidRootPart") do
  9.         wait(0.5)
  10.     end
  11.     return LocalPlayer.Character
  12. end
  13.  
  14. -- Create ScreenGui
  15. local screenGui = Instance.new("ScreenGui")
  16. screenGui.Parent = LocalPlayer.PlayerGui
  17. screenGui.ResetOnSpawn = false
  18. screenGui.Enabled = true -- Меню видно сразу
  19.  
  20. -- Create main frame
  21. local frame = Instance.new("Frame")
  22. frame.Size = UDim2.new(0, 300, 0, 200)
  23. frame.Position = UDim2.new(0.5, -150, 0.5, -100)
  24. frame.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  25. frame.BackgroundTransparency = 0.2
  26. frame.Active = true
  27. frame.Draggable = true
  28. frame.Parent = screenGui
  29.  
  30. -- Create title label for coordinates
  31. local coordLabel = Instance.new("TextLabel")
  32. coordLabel.Size = UDim2.new(1, 0, 0, 30)
  33. coordLabel.Position = UDim2.new(0, 0, 0, 0)
  34. coordLabel.BackgroundTransparency = 1
  35. coordLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  36. coordLabel.Text = "X: 0, Y: 0, Z: 0"
  37. coordLabel.Parent = frame
  38.  
  39. -- Create Stage 1 button
  40. local stage1Button = Instance.new("TextButton")
  41. stage1Button.Size = UDim2.new(0, 100, 0, 30)
  42. stage1Button.Position = UDim2.new(0, 10, 0, 40)
  43. stage1Button.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  44. stage1Button.TextColor3 = Color3.fromRGB(255, 255, 255)
  45. stage1Button.Text = "Start Challenge"
  46. stage1Button.Parent = frame
  47.  
  48. -- Variables
  49. local isMinimized = false
  50. local isMoving = false
  51. local waypoints = {
  52.     Vector3.new(320.00, 0, -461.78),
  53.     Vector3.new(212.07, 0, -461.78),
  54.     Vector3.new(212.07, 0, -640.35),
  55.     Vector3.new(244.00, 0, -640.35)
  56. }
  57. local currentWaypointIndex = 0
  58.  
  59. -- Function to update coordinates
  60. local function startCoordinateUpdates()
  61.     RunService.RenderStepped:Connect(function()
  62.         if LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
  63.             local pos = LocalPlayer.Character.HumanoidRootPart.Position
  64.             coordLabel.Text = string.format("X: %.2f, Y: %.2f, Z: %.2f", pos.X, pos.Y, pos.Z)
  65.         else
  66.             coordLabel.Text = "X: 0, Y: 0, Z: 0"
  67.         end
  68.     end)
  69. end
  70.  
  71. -- Start coordinate updates after character load
  72. spawn(function()
  73.     waitForCharacter()
  74.     startCoordinateUpdates()
  75. end)
  76.  
  77. -- Home key functionality (minimize/maximize)
  78. UserInputService.InputBegan:Connect(function(input, gameProcessed)
  79.     if gameProcessed then return end
  80.     if input.KeyCode == Enum.KeyCode.Home then
  81.         isMinimized = not isMinimized
  82.         if isMinimized then
  83.             frame.Size = UDim2.new(0, 300, 0, 30)
  84.             stage1Button.Visible = false
  85.         else
  86.             frame.Size = UDim2.new(0, 300, 0, 200)
  87.             stage1Button.Visible = true
  88.         end
  89.     end
  90. end)
  91.  
  92. -- Insert key functionality (disable script)
  93. UserInputService.InputBegan:Connect(function(input, gameProcessed)
  94.     if gameProcessed then return end
  95.     if input.KeyCode == Enum.KeyCode.Insert then
  96.         screenGui:Destroy()
  97.     end
  98. end)
  99.  
  100. -- Function to click a button (generic)
  101. local function clickButton(button)
  102.     if button then
  103.         local clickDetector = button:FindFirstChildOfClass("ClickDetector")
  104.         if clickDetector then
  105.             fireclickdetector(clickDetector)
  106.         elseif button:IsA("TextButton") then
  107.             local connections = getconnections(button.Activated) or getconnections(button.MouseButton1Click)
  108.             for _, connection in pairs(connections) do
  109.                 connection:Fire()
  110.             end
  111.         end
  112.     end
  113. end
  114.  
  115. -- Function to click the Start button
  116. local function clickStartButton()
  117.     local startButton = LocalPlayer.PlayerGui:FindFirstChild("MiniLobbyInterface")
  118.         and LocalPlayer.PlayerGui.MiniLobbyInterface:FindFirstChild("Holder")
  119.         and LocalPlayer.PlayerGui.MiniLobbyInterface.Holder:FindFirstChild("Buttons")
  120.         and LocalPlayer.PlayerGui.MiniLobbyInterface.Holder.Buttons:FindFirstChild("Start")
  121.         and LocalPlayer.PlayerGui.MiniLobbyInterface.Holder.Buttons.Start:FindFirstChild("Button")
  122.    
  123.     if startButton then
  124.         clickButton(startButton)
  125.     end
  126. end
  127.  
  128. -- Function to click the Play button and save StageName before Start
  129. local function clickPlayButton(challengeTemplate)
  130.     local playButton = challengeTemplate:FindFirstChild("SideFrame")
  131.         and challengeTemplate.SideFrame:FindFirstChild("Play")
  132.         and challengeTemplate.SideFrame.Play:FindFirstChild("Button")
  133.    
  134.     if playButton then
  135.         clickButton(playButton) -- Нажимаем Play
  136.         wait(1) -- Ждём немного после нажатия Play
  137.         -- Получаем StageName
  138.         local stageNameLabel = LocalPlayer.PlayerGui:FindFirstChild("MiniLobbyInterface")
  139.             and LocalPlayer.PlayerGui.MiniLobbyInterface:FindFirstChild("Holder")
  140.             and LocalPlayer.PlayerGui.MiniLobbyInterface.Holder:FindFirstChild("Info")
  141.             and LocalPlayer.PlayerGui.MiniLobbyInterface.Holder.Info:FindFirstChild("Container")
  142.             and LocalPlayer.PlayerGui.MiniLobbyInterface.Holder.Info.Container:FindFirstChild("Main")
  143.             and LocalPlayer.PlayerGui.MiniLobbyInterface.Holder.Info.Container.Main:FindFirstChild("StageName")
  144.        
  145.         -- Читаем существующие Stage и Act из файла (если файл существует)
  146.         local stageText = "Not available"
  147.         local actText = "Not available"
  148.         if isfile("actinfo.txt") then
  149.             local fileContent = readfile("actinfo.txt")
  150.             local lines = {}
  151.             for line in fileContent:gmatch("[^\r\n]+") do
  152.                 table.insert(lines, line)
  153.             end
  154.             if #lines >= 2 then
  155.                 stageText = lines[2] or "Not available"
  156.                 actText = lines[3] or "Not available"
  157.             end
  158.         end
  159.  
  160.         -- Получаем StageName
  161.         local stageNameText = "Not available"
  162.         if stageNameLabel and stageNameLabel:IsA("TextLabel") then
  163.             stageNameText = stageNameLabel.Text
  164.             print("StageName found: " .. stageNameText)
  165.         else
  166.             print("StageName label not found")
  167.         end
  168.  
  169.         -- Формируем содержимое файла
  170.         local fileContent = "Act info :\n" .. stageText .. "\n" .. actText .. "\n" .. stageNameText
  171.         writefile("actinfo.txt", fileContent)
  172.         print("Updated actinfo.txt with StageName: " .. stageNameText)
  173.  
  174.         -- Нажимаем Start
  175.         clickStartButton()
  176.     end
  177. end
  178.  
  179. -- Function to check ResetTime and save Stage/Act before Play
  180. local function checkResetTime(challengeTemplate)
  181.     local resetTimeLabel = challengeTemplate:FindFirstChild("SideFrame")
  182.         and challengeTemplate.SideFrame:FindFirstChild("ResetTime")
  183.    
  184.     if resetTimeLabel and resetTimeLabel:IsA("TextLabel") then
  185.         if resetTimeLabel.Text == "Available" then
  186.             print("ResetTime: Available, saving Stage and Act")
  187.             -- Получаем Stage и Act из ChallengeTemplate
  188.             local stageLabel = challengeTemplate:FindFirstChild("ChallengeStage")
  189.                 and challengeTemplate.ChallengeStage:FindFirstChild("Stage")
  190.                 and challengeTemplate.ChallengeStage.Stage:FindFirstChild("Label")
  191.             local actLabel = challengeTemplate:FindFirstChild("ChallengeStage")
  192.                 and challengeTemplate.ChallengeStage:FindFirstChild("Act")
  193.                 and challengeTemplate.ChallengeStage.Act:FindFirstChild("Label")
  194.  
  195.             local stageText = "Not available"
  196.             local actText = "Not available"
  197.  
  198.             if stageLabel and stageLabel:IsA("TextLabel") then
  199.                 stageText = stageLabel.Text
  200.                 print("Stage found: " .. stageText)
  201.             else
  202.                 print("Stage label not found")
  203.             end
  204.  
  205.             if actLabel and actLabel:IsA("TextLabel") then
  206.                 actText = actLabel.Text
  207.                 print("Act found: " .. actText)
  208.             else
  209.                 print("Act label not found")
  210.             end
  211.  
  212.             -- Формируем начальное содержимое файла (без StageName)
  213.             local fileContent = "Act info :\n" .. stageText .. "\n" .. actText .. "\nNot available"
  214.             writefile("actinfo.txt", fileContent)
  215.             print("Saved Stage and Act to actinfo.txt")
  216.  
  217.             -- Нажимаем Play
  218.             clickPlayButton(challengeTemplate)
  219.         else
  220.             print("ResetTime: ", resetTimeLabel.Text, " (waiting for 'Available')")
  221.             spawn(function()
  222.                 while resetTimeLabel and resetTimeLabel.Text ~= "Available" do
  223.                     wait(1)
  224.                     if not resetTimeLabel or not resetTimeLabel.Parent then break end
  225.                     if resetTimeLabel.Text == "Available" then
  226.                         print("ResetTime became: Available, saving Stage and Act")
  227.                         -- Получаем Stage и Act из ChallengeTemplate
  228.                         local stageLabel = challengeTemplate:FindFirstChild("ChallengeStage")
  229.                             and challengeTemplate.ChallengeStage:FindFirstChild("Stage")
  230.                             and challengeTemplate.ChallengeStage.Stage:FindFirstChild("Label")
  231.                         local actLabel = challengeTemplate:FindFirstChild("ChallengeStage")
  232.                             and challengeTemplate.ChallengeStage:FindFirstChild("Act")
  233.                             and challengeTemplate.ChallengeStage.Act:FindFirstChild("Label")
  234.  
  235.                         local stageText = "Not available"
  236.                         local actText = "Not available"
  237.  
  238.                         if stageLabel and stageLabel:IsA("TextLabel") then
  239.                             stageText = stageLabel.Text
  240.                             print("Stage found: " .. stageText)
  241.                         else
  242.                             print("Stage label not found")
  243.                         end
  244.  
  245.                         if actLabel and actLabel:IsA("TextLabel") then
  246.                             actText = actLabel.Text
  247.                             print("Act found: " .. actText)
  248.                         else
  249.                             print("Act label not found")
  250.                         end
  251.  
  252.                         -- Формируем начальное содержимое файла (без StageName)
  253.                         local fileContent = "Act info :\n" .. stageText .. "\n" .. actText .. "\nNot available"
  254.                         writefile("actinfo.txt", fileContent)
  255.                         print("Saved Stage and Act to actinfo.txt")
  256.  
  257.                         -- Нажимаем Play
  258.                         clickPlayButton(challengeTemplate)
  259.                         break
  260.                     else
  261.                         print("ResetTime: ", resetTimeLabel.Text, " (waiting for 'Available')")
  262.                     end
  263.                 end
  264.             end)
  265.         end
  266.     end
  267. end
  268.  
  269. -- Function to search for ChallengeTemplate with "Trait Reroll Challenge"
  270. local function searchChallengeTemplate()
  271.     local challengesList = LocalPlayer.PlayerGui:FindFirstChild("Challenges")
  272.         and LocalPlayer.PlayerGui.Challenges:FindFirstChild("Holder")
  273.         and LocalPlayer.PlayerGui.Challenges.Holder:FindFirstChild("ChallengesList")
  274.    
  275.     if challengesList then
  276.         for _, child in pairs(challengesList:GetChildren()) do
  277.             if child.Name == "ChallengeTemplate" and child:IsA("Frame") then
  278.                 local textLabel = child:FindFirstChildOfClass("TextLabel")
  279.                 if textLabel and textLabel:IsA("TextLabel") and textLabel.Text == "Trait Reroll Challenge" then
  280.                     checkResetTime(child)
  281.                     return
  282.                 end
  283.             end
  284.         end
  285.     end
  286. end
  287.  
  288. -- Function to click the Create button with 500ms delay
  289. local function clickCreateButton()
  290.     local button = LocalPlayer.PlayerGui:FindFirstChild("LobbyInterface")
  291.         and LocalPlayer.PlayerGui.LobbyInterface:FindFirstChild("Holder")
  292.         and LocalPlayer.PlayerGui.LobbyInterface.Holder:FindFirstChild("Buttons")
  293.         and LocalPlayer.PlayerGui.LobbyInterface.Holder.Buttons:FindFirstChild("Create")
  294.    
  295.     if button and button:IsA("Frame") then
  296.         local clickDetector = button:FindFirstChildOfClass("ClickDetector")
  297.         if clickDetector then
  298.             fireclickdetector(clickDetector)
  299.         else
  300.             local textButton = button:FindFirstChildOfClass("TextButton")
  301.             if textButton then
  302.                 local connections = getconnections(textButton.Activated) or getconnections(textButton.MouseButton1Click)
  303.                 for _, connection in pairs(connections) do
  304.                     connection:Fire()
  305.                 end
  306.             else
  307.                 local connections = getconnections(button.Activated) or getconnections(button.MouseButton1Click)
  308.                 for _, connection in pairs(connections) do
  309.                     connection:Fire()
  310.                 end
  311.             end
  312.         end
  313.         wait(0.5) -- Задержка 500 мс после нажатия Create
  314.         searchChallengeTemplate()
  315.     end
  316. end
  317.  
  318. -- Function to move to a waypoint
  319. local function moveToWaypoint(waypoint)
  320.     if not LocalPlayer.Character or not LocalPlayer.Character:FindFirstChild("Humanoid") then
  321.         return
  322.     end
  323.     local humanoid = LocalPlayer.Character.Humanoid
  324.     humanoid.WalkSpeed = 30
  325.     humanoid:MoveTo(waypoint)
  326.    
  327.     local connection
  328.     connection = RunService.Heartbeat:Connect(function()
  329.         if not LocalPlayer.Character or not LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
  330.             connection:Disconnect()
  331.             return
  332.         end
  333.         local pos = LocalPlayer.Character.HumanoidRootPart.Position
  334.         local distance = (Vector3.new(pos.X, 0, pos.Z) - Vector3.new(waypoint.X, 0, waypoint.Z)).Magnitude
  335.         if distance < 2 or not isMoving then
  336.             connection:Disconnect()
  337.             if isMoving then
  338.                 currentWaypointIndex = currentWaypointIndex + 1
  339.                 if currentWaypointIndex <= #waypoints then
  340.                     moveToWaypoint(waypoints[currentWaypointIndex])
  341.                 else
  342.                     isMoving = false
  343.                     humanoid.WalkSpeed = 16
  344.                     wait(1)
  345.                     clickCreateButton()
  346.                 end
  347.             end
  348.         end
  349.     end)
  350. end
  351.  
  352. -- Stage 1 button functionality (manual click only)
  353. stage1Button.MouseButton1Click:Connect(function()
  354.     if not LocalPlayer.Character or not LocalPlayer.Character:FindFirstChild("Humanoid") then
  355.         return
  356.     end
  357.     isMoving = true
  358.     currentWaypointIndex = 1
  359.     moveToWaypoint(waypoints[currentWaypointIndex])
  360. end)
Advertisement
Add Comment
Please, Sign In to add comment