From venuslock, 2 Weeks ago, written in Lua.
Embed
  1. -- Auto Train GUI
  2. -- Creates a simple GUI to select world and machine number for auto training
  3.  
  4. -- Initialize global variables
  5. _G.testing = false
  6. _G.worldNumber = 3
  7. _G.machineNumber = 1
  8.  
  9. -- Create GUI
  10. local ScreenGui = Instance.new("ScreenGui")
  11. local MainFrame = Instance.new("Frame")
  12. local UICorner = Instance.new("UICorner")
  13. local Title = Instance.new("TextLabel")
  14. local WorldFrame = Instance.new("Frame")
  15. local WorldTitle = Instance.new("TextLabel")
  16. local World1Button = Instance.new("TextButton")
  17. local World2Button = Instance.new("TextButton")
  18. local World3Button = Instance.new("TextButton")
  19. local MachineFrame = Instance.new("Frame")
  20. local MachineTitle = Instance.new("TextLabel")
  21. local MachineInput = Instance.new("TextBox")
  22. local StatusLabel = Instance.new("TextLabel")
  23. local StartButton = Instance.new("TextButton")
  24. local StopButton = Instance.new("TextButton")
  25.  
  26. -- Parent GUI to player
  27. ScreenGui.Parent = game:GetService("CoreGui")
  28. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  29.  
  30. -- Main Frame
  31. MainFrame.Name = "MainFrame"
  32. MainFrame.Parent = ScreenGui
  33. MainFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  34. MainFrame.Position = UDim2.new(0.5, -150, 0.5, -125)
  35. MainFrame.Size = UDim2.new(0, 300, 0, 250)
  36. MainFrame.Active = true
  37. MainFrame.Draggable = true
  38.  
  39. -- Add corner radius to main frame
  40. UICorner.Parent = MainFrame
  41.  
  42. -- Title
  43. Title.Name = "Title"
  44. Title.Parent = MainFrame
  45. Title.BackgroundTransparency = 1
  46. Title.Position = UDim2.new(0, 0, 0, 10)
  47. Title.Size = UDim2.new(1, 0, 0, 30)
  48. Title.Font = Enum.Font.SourceSansBold
  49. Title.Text = "Auto Train GUI"
  50. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  51. Title.TextSize = 22
  52.  
  53. -- World Selection Frame
  54. WorldFrame.Name = "WorldFrame"
  55. WorldFrame.Parent = MainFrame
  56. WorldFrame.BackgroundTransparency = 1
  57. WorldFrame.Position = UDim2.new(0, 20, 0, 50)
  58. WorldFrame.Size = UDim2.new(0, 260, 0, 60)
  59.  
  60. -- World Title
  61. WorldTitle.Name = "WorldTitle"
  62. WorldTitle.Parent = WorldFrame
  63. WorldTitle.BackgroundTransparency = 1
  64. WorldTitle.Position = UDim2.new(0, 0, 0, 0)
  65. WorldTitle.Size = UDim2.new(1, 0, 0, 20)
  66. WorldTitle.Font = Enum.Font.SourceSans
  67. WorldTitle.Text = "Select World:"
  68. WorldTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  69. WorldTitle.TextSize = 16
  70. WorldTitle.TextXAlignment = Enum.TextXAlignment.Left
  71.  
  72. -- World Buttons
  73. World1Button.Name = "World1Button"
  74. World1Button.Parent = WorldFrame
  75. World1Button.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  76. World1Button.Position = UDim2.new(0, 0, 0, 25)
  77. World1Button.Size = UDim2.new(0, 80, 0, 30)
  78. World1Button.Font = Enum.Font.SourceSans
  79. World1Button.Text = "World 1"
  80. World1Button.TextColor3 = Color3.fromRGB(255, 255, 255)
  81. World1Button.TextSize = 16
  82.  
  83. World2Button.Name = "World2Button"
  84. World2Button.Parent = WorldFrame
  85. World2Button.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  86. World2Button.Position = UDim2.new(0, 90, 0, 25)
  87. World2Button.Size = UDim2.new(0, 80, 0, 30)
  88. World2Button.Font = Enum.Font.SourceSans
  89. World2Button.Text = "World 2"
  90. World2Button.TextColor3 = Color3.fromRGB(255, 255, 255)
  91. World2Button.TextSize = 16
  92.  
  93. World3Button.Name = "World3Button"
  94. World3Button.Parent = WorldFrame
  95. World3Button.BackgroundColor3 = Color3.fromRGB(50, 150, 50) -- Default selected
  96. World3Button.Position = UDim2.new(0, 180, 0, 25)
  97. World3Button.Size = UDim2.new(0, 80, 0, 30)
  98. World3Button.Font = Enum.Font.SourceSans
  99. World3Button.Text = "World 3"
  100. World3Button.TextColor3 = Color3.fromRGB(255, 255, 255)
  101. World3Button.TextSize = 16
  102.  
  103. -- Machine Selection Frame
  104. MachineFrame.Name = "MachineFrame"
  105. MachineFrame.Parent = MainFrame
  106. MachineFrame.BackgroundTransparency = 1
  107. MachineFrame.Position = UDim2.new(0, 20, 0, 120)
  108. MachineFrame.Size = UDim2.new(0, 260, 0, 60)
  109.  
  110. -- Machine Title
  111. MachineTitle.Name = "MachineTitle"
  112. MachineTitle.Parent = MachineFrame
  113. MachineTitle.BackgroundTransparency = 1
  114. MachineTitle.Position = UDim2.new(0, 0, 0, 0)
  115. MachineTitle.Size = UDim2.new(1, 0, 0, 20)
  116. MachineTitle.Font = Enum.Font.SourceSans
  117. MachineTitle.Text = "Machine Number (1-12):"
  118. MachineTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  119. MachineTitle.TextSize = 16
  120. MachineTitle.TextXAlignment = Enum.TextXAlignment.Left
  121.  
  122. -- Machine Input
  123. MachineInput.Name = "MachineInput"
  124. MachineInput.Parent = MachineFrame
  125. MachineInput.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  126. MachineInput.Position = UDim2.new(0, 0, 0, 25)
  127. MachineInput.Size = UDim2.new(1, 0, 0, 30)
  128. MachineInput.Font = Enum.Font.SourceSans
  129. MachineInput.Text = "1"
  130. MachineInput.TextColor3 = Color3.fromRGB(255, 255, 255)
  131. MachineInput.TextSize = 16
  132.  
  133. -- Status Label
  134. StatusLabel.Name = "StatusLabel"
  135. StatusLabel.Parent = MainFrame
  136. StatusLabel.BackgroundTransparency = 1
  137. StatusLabel.Position = UDim2.new(0, 20, 0, 185)
  138. StatusLabel.Size = UDim2.new(0, 260, 0, 20)
  139. StatusLabel.Font = Enum.Font.SourceSans
  140. StatusLabel.Text = "Status: Ready"
  141. StatusLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  142. StatusLabel.TextSize = 16
  143. StatusLabel.TextXAlignment = Enum.TextXAlignment.Left
  144.  
  145. -- Start Button
  146. StartButton.Name = "StartButton"
  147. StartButton.Parent = MainFrame
  148. StartButton.BackgroundColor3 = Color3.fromRGB(50, 150, 50)
  149. StartButton.Position = UDim2.new(0, 20, 0, 210)
  150. StartButton.Size = UDim2.new(0, 125, 0, 30)
  151. StartButton.Font = Enum.Font.SourceSansBold
  152. StartButton.Text = "START"
  153. StartButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  154. StartButton.TextSize = 16
  155.  
  156. -- Stop Button
  157. StopButton.Name = "StopButton"
  158. StopButton.Parent = MainFrame
  159. StopButton.BackgroundColor3 = Color3.fromRGB(150, 50, 50)
  160. StopButton.Position = UDim2.new(0, 155, 0, 210)
  161. StopButton.Size = UDim2.new(0, 125, 0, 30)
  162. StopButton.Font = Enum.Font.SourceSansBold
  163. StopButton.Text = "STOP"
  164. StopButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  165. StopButton.TextSize = 16
  166.  
  167. -- Function to update button colors when selected
  168. local function updateWorldButtons(selected)
  169.     World1Button.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  170.     World2Button.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  171.     World3Button.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  172.    
  173.     if selected == 1 then
  174.         World1Button.BackgroundColor3 = Color3.fromRGB(50, 150, 50)
  175.     elseif selected == 2 then
  176.         World2Button.BackgroundColor3 = Color3.fromRGB(50, 150, 50)
  177.     elseif selected == 3 then
  178.         World3Button.BackgroundColor3 = Color3.fromRGB(50, 150, 50)
  179.     end
  180. end
  181.  
  182. -- World button click events
  183. World1Button.MouseButton1Click:Connect(function()
  184.     _G.worldNumber = 1
  185.     updateWorldButtons(1)
  186.     StatusLabel.Text = "Status: Selected World 1"
  187. end)
  188.  
  189. World2Button.MouseButton1Click:Connect(function()
  190.     _G.worldNumber = 2
  191.     updateWorldButtons(2)
  192.     StatusLabel.Text = "Status: Selected World 2"
  193. end)
  194.  
  195. World3Button.MouseButton1Click:Connect(function()
  196.     _G.worldNumber = 3
  197.     updateWorldButtons(3)
  198.     StatusLabel.Text = "Status: Selected World 3"
  199. end)
  200.  
  201. -- Machine input validation
  202. MachineInput.FocusLost:Connect(function(enterPressed)
  203.     local inputText = MachineInput.Text
  204.     local machineNum = tonumber(inputText)
  205.    
  206.     if machineNum then
  207.         if machineNum >= 1 and machineNum <= 12 then
  208.             _G.machineNumber = machineNum
  209.             StatusLabel.Text = "Status: Set to Machine " .. machineNum
  210.         else
  211.             MachineInput.Text = "1"
  212.             _G.machineNumber = 1
  213.             StatusLabel.Text = "Status: Invalid number, reset to 1"
  214.         end
  215.     else
  216.         MachineInput.Text = "1"
  217.         _G.machineNumber = 1
  218.         StatusLabel.Text = "Status: Invalid input, reset to 1"
  219.     end
  220. end)
  221.  
  222. -- Auto train function
  223. local autoTrainRunning = false
  224. local autoTrainConnection = nil
  225.  
  226. local function startAutoTrain()
  227.     if autoTrainRunning then return end
  228.    
  229.     _G.testing = true
  230.     autoTrainRunning = true
  231.    
  232.     autoTrainConnection = task.spawn(function()
  233.         local replicatedStorage = game:GetService("ReplicatedStorage")
  234.         local event = replicatedStorage:WaitForChild("Event")
  235.         local remoteEvent = event:WaitForChild("RemoteEvent")
  236.         local cToS = remoteEvent:WaitForChild("CToS")
  237.         local gameFolder = cToS:WaitForChild("Game")
  238.         local cStartTrain = gameFolder:WaitForChild("CStartTrain")
  239.         local cPlayerClick = gameFolder:WaitForChild("CPlayerClick")
  240.        
  241.         -- First: start the training once
  242.         cStartTrain:FireServer(true, "Train_" .. _G.worldNumber .. "_" .. _G.machineNumber)
  243.         StatusLabel.Text = "Status: Started on World " .. _G.worldNumber .. ", Machine " .. _G.machineNumber
  244.        
  245.         task.wait(0.2) -- small delay to let the server prepare
  246.        
  247.         -- Second: keep clicking while toggle is true
  248.         while _G.testing do
  249.             local args = {
  250.                 [1] = "Train_" .. _G.worldNumber .. "_" .. _G.machineNumber
  251.             }
  252.             cPlayerClick:FireServer(unpack(args))
  253.             task.wait(0.01) -- click speed
  254.         end
  255.     end)
  256. end
  257.  
  258. local function stopAutoTrain()
  259.     _G.testing = false
  260.     autoTrainRunning = false
  261.     StatusLabel.Text = "Status: Stopped"
  262. end
  263.  
  264. -- Button click events
  265. StartButton.MouseButton1Click:Connect(function()
  266.     startAutoTrain()
  267. end)
  268.  
  269. StopButton.MouseButton1Click:Connect(function()
  270.     stopAutoTrain()
  271. end)
  272.  
  273. -- Initialize with World 3 selected
  274. updateWorldButtons(3)

captcha