Advertisement
Flpppp

Roblox script dont press a button 4 remastered

Jul 12th, 2025 (edited)
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.55 KB | Gaming | 0 0
  1. local TweenService = game:GetService("TweenService")
  2. local Players = game:GetService("Players")
  3.  
  4. local player = Players.LocalPlayer
  5.  
  6. local tpEnabled = false
  7. local walkEnabled = false
  8. local minimized = false
  9.  
  10. local tpSpeed = 0.15
  11. local walkSpeed = 16
  12. local coinName = "Coin"
  13.  
  14. local originalProperties = {}
  15.  
  16. local function findAllCoins()
  17.     local coins = {}
  18.     for _, part in ipairs(workspace:GetDescendants()) do
  19.         if part:IsA("BasePart") and part.Name == coinName then
  20.             table.insert(coins, part)
  21.         end
  22.     end
  23.     return coins
  24. end
  25.  
  26. local function teleportLoop()
  27.     while true do
  28.         if tpEnabled then
  29.             local character = player.Character
  30.             local humanoid = character and character:FindFirstChildOfClass("Humanoid")
  31.             local rootPart = character and character:FindFirstChild("HumanoidRootPart")
  32.             if character and humanoid and rootPart then
  33.                 local coins = findAllCoins()
  34.                 for _, coin in ipairs(coins) do
  35.                     if not tpEnabled then break end
  36.                     rootPart.CFrame = CFrame.new(coin.Position + Vector3.new(0, 1, 0))
  37.                     humanoid:Move(Vector3.new(1, 0, 0), true)
  38.                     humanoid.Jump = false
  39.                     task.wait(tpSpeed)
  40.                 end
  41.             end
  42.         end
  43.         task.wait(tpSpeed)
  44.     end
  45. end
  46.  
  47. task.spawn(teleportLoop)
  48.  
  49. local function blockJoystick()
  50.     task.spawn(function()
  51.         local playerGui = player:WaitForChild("PlayerGui")
  52.         local joystickFrame = nil
  53.  
  54.         for i = 1, 50 do
  55.             local touchGui = playerGui:FindFirstChild("TouchGui", true)
  56.             if touchGui then
  57.                 joystickFrame = touchGui:FindFirstChild("DynamicThumbstickFrame", true)
  58.                 if joystickFrame then
  59.                     break
  60.                 end
  61.             end
  62.             task.wait(0.2)
  63.         end
  64.  
  65.         if joystickFrame then
  66.             if not joystickFrame.Parent:FindFirstChild("JoystickBlocker") then
  67.                 local blocker = Instance.new("Frame")
  68.                 blocker.Name = "JoystickBlocker"
  69.                 blocker.Size = joystickFrame.Size
  70.                 blocker.Position = joystickFrame.Position
  71.                 blocker.AnchorPoint = joystickFrame.AnchorPoint
  72.                 blocker.BackgroundTransparency = 1
  73.                 blocker.ZIndex = joystickFrame.ZIndex + 99999999999999
  74.                 blocker.Active = true
  75.                 blocker.Parent = joystickFrame.Parent
  76.  
  77.                 joystickFrame:GetPropertyChangedSignal("Position"):Connect(function()
  78.                     blocker.Position = joystickFrame.Position
  79.                 end)
  80.                 joystickFrame:GetPropertyChangedSignal("Size"):Connect(function()
  81.                     blocker.Size = joystickFrame.Size
  82.                 end)
  83.             end
  84.         else
  85.             warn("Joystick not found to block.")
  86.         end
  87.     end)
  88. end
  89.  
  90. local function unblockJoystick()
  91.     local playerGui = player:FindFirstChild("PlayerGui")
  92.     if playerGui then
  93.         local touchGui = playerGui:FindFirstChild("TouchGui", true)
  94.         if touchGui then
  95.             local blocker = touchGui:FindFirstChild("JoystickBlocker", true)
  96.             if blocker then
  97.                 blocker:Destroy()
  98.             end
  99.         end
  100.     end
  101. end
  102.  
  103. local screenGui = Instance.new("ScreenGui")
  104. screenGui.ResetOnSpawn = false
  105. screenGui.Parent = game.CoreGui
  106.  
  107. local frame = Instance.new("Frame")
  108. frame.Size = UDim2.new(0, 240, 0, 140)
  109. frame.Position = UDim2.new(0.5, -120, 0.5, -70)
  110. frame.BackgroundColor3 = Color3.new(0, 0, 0)
  111. frame.BorderSizePixel = 1
  112. frame.BorderColor3 = Color3.new(1, 1, 1)
  113. frame.Active = true
  114. frame.Draggable = true
  115. frame.Parent = screenGui
  116. frame.BackgroundTransparency = 0
  117. frame.Visible = false
  118.  
  119. local corner = Instance.new("UICorner")
  120. corner.CornerRadius = UDim.new(0, 6)
  121. corner.Parent = frame
  122.  
  123. local titleBar = Instance.new("Frame")
  124. titleBar.Size = UDim2.new(1, 0, 0, 25)
  125. titleBar.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  126. titleBar.BorderSizePixel = 1
  127. titleBar.BorderColor3 = Color3.new(1, 1, 1)
  128. titleBar.Parent = frame
  129.  
  130. local titleText = Instance.new("TextLabel")
  131. titleText.Size = UDim2.new(1, -30, 1, 0)
  132. titleText.Position = UDim2.new(0, 5, 0, 0)
  133. titleText.BackgroundTransparency = 1
  134. titleText.Text = "AutoFarm"
  135. titleText.TextColor3 = Color3.new(1, 1, 1)
  136. titleText.Font = Enum.Font.SourceSansBold
  137. titleText.TextSize = 14
  138. titleText.TextXAlignment = Enum.TextXAlignment.Left
  139. titleText.Parent = titleBar
  140.  
  141. local minimizeButton = Instance.new("TextButton")
  142. minimizeButton.Size = UDim2.new(0, 25, 1, 0)
  143. minimizeButton.Position = UDim2.new(1, -25, 0, 0)
  144. minimizeButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  145. minimizeButton.Text = "X"
  146. minimizeButton.TextColor3 = Color3.new(1, 1, 1)
  147. minimizeButton.Font = Enum.Font.SourceSansBold
  148. minimizeButton.TextSize = 14
  149. minimizeButton.Parent = titleBar
  150.  
  151. local minCorner = Instance.new("UICorner")
  152. minCorner.CornerRadius = UDim.new(0, 3)
  153. minCorner.Parent = minimizeButton
  154.  
  155. local content = Instance.new("Frame")
  156. content.Size = UDim2.new(1, -20, 1, -35)
  157. content.Position = UDim2.new(0, 10, 0, 25)
  158. content.BackgroundTransparency = 1
  159. content.Parent = frame
  160.  
  161. local tpLabel = Instance.new("TextLabel")
  162. tpLabel.Size = UDim2.new(0.5, -5, 0, 18)
  163. tpLabel.Position = UDim2.new(0, 0, 0, 10)
  164. tpLabel.BackgroundTransparency = 1
  165. tpLabel.Text = "TP Speed (s)"
  166. tpLabel.TextColor3 = Color3.new(1, 1, 1)
  167. tpLabel.Font = Enum.Font.SourceSansBold
  168. tpLabel.TextSize = 12
  169. tpLabel.Parent = content
  170.  
  171. local walkLabel = tpLabel:Clone()
  172. walkLabel.Position = UDim2.new(0.5, 5, 0, 10)
  173. walkLabel.Text = "Walk Speed"
  174. walkLabel.Parent = content
  175.  
  176. local tpBox = Instance.new("TextBox")
  177. tpBox.Size = UDim2.new(0.5, -5, 0, 20)
  178. tpBox.Position = UDim2.new(0, 0, 0, 35)
  179. tpBox.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  180. tpBox.TextColor3 = Color3.new(1, 1, 1)
  181. tpBox.Text = tostring(tpSpeed)
  182. tpBox.Font = Enum.Font.SourceSansBold
  183. tpBox.TextSize = 12
  184. tpBox.Parent = content
  185.  
  186. local tpCorner = Instance.new("UICorner")
  187. tpCorner.CornerRadius = UDim.new(0, 5)
  188. tpCorner.Parent = tpBox
  189.  
  190. tpBox.FocusLost:Connect(function(enterPressed)
  191.     if enterPressed then
  192.         local val = tonumber(tpBox.Text)
  193.         if val and val > 0 then
  194.             tpSpeed = val
  195.         else
  196.             tpBox.Text = tostring(tpSpeed)
  197.         end
  198.     end
  199. end)
  200.  
  201. local walkBox = tpBox:Clone()
  202. walkBox.Position = UDim2.new(0.5, 5, 0, 35)
  203. walkBox.Text = tostring(walkSpeed)
  204. walkBox.Parent = content
  205.  
  206. walkBox.FocusLost:Connect(function(enterPressed)
  207.     if enterPressed then
  208.         local val = tonumber(walkBox.Text)
  209.         if val and val > 0 then
  210.             walkSpeed = val
  211.         else
  212.             walkBox.Text = tostring(walkSpeed)
  213.         end
  214.     end
  215. end)
  216.  
  217. local function updateButtonVisual(btn, isOn)
  218.     if isOn then
  219.         btn.BackgroundColor3 = Color3.new(1, 1, 1)
  220.         btn.TextColor3 = Color3.new(0, 0, 0)
  221.     else
  222.         btn.BackgroundColor3 = Color3.new(0.4, 0.4, 0.4)
  223.         btn.TextColor3 = Color3.new(1, 1, 1)
  224.     end
  225. end
  226.  
  227. local tpButton = Instance.new("TextButton")
  228. tpButton.Size = UDim2.new(0.5, -5, 0, 25)
  229. tpButton.Position = UDim2.new(0, 0, 0, 65)
  230. tpButton.Text = "TP: OFF"
  231. tpButton.Font = Enum.Font.SourceSansBold
  232. tpButton.TextSize = 12
  233. tpButton.Parent = content
  234. updateButtonVisual(tpButton, tpEnabled)
  235.  
  236. local tpBtnCorner = Instance.new("UICorner")
  237. tpBtnCorner.CornerRadius = UDim.new(0, 5)
  238. tpBtnCorner.Parent = tpButton
  239.  
  240. tpButton.MouseButton1Click:Connect(function()
  241.     tpEnabled = not tpEnabled
  242.     tpButton.Text = tpEnabled and "TP: ON" or "TP: OFF"
  243.     updateButtonVisual(tpButton, tpEnabled)
  244. end)
  245.  
  246. local walkButton = tpButton:Clone()
  247. walkButton.Position = UDim2.new(0.5, 5, 0, 65)
  248. walkButton.Text = "Walk: OFF"
  249. walkButton.Parent = content
  250. updateButtonVisual(walkButton, walkEnabled)
  251.  
  252. local walkLoopConnection = nil
  253.  
  254. walkButton.MouseButton1Click:Connect(function()
  255.     walkEnabled = not walkEnabled
  256.     walkButton.Text = walkEnabled and "Walk: ON" or "Walk: OFF"
  257.     updateButtonVisual(walkButton, walkEnabled)
  258.  
  259.     if walkEnabled then
  260.         blockJoystick()
  261.  
  262.         walkLoopConnection = task.spawn(function()
  263.             while walkEnabled do
  264.                 local character = player.Character
  265.                 local humanoid = character and character:FindFirstChildOfClass("Humanoid")
  266.                 local rootPart = character and character:FindFirstChild("HumanoidRootPart")
  267.                 if character and humanoid and rootPart then
  268.                     humanoid.WalkSpeed = walkSpeed
  269.                     local coins = findAllCoins()
  270.                     for _, coin in ipairs(coins) do
  271.                         if not walkEnabled then break end
  272.                         humanoid:MoveTo(coin.Position + Vector3.new(0, 1, 0))
  273.                         humanoid.MoveToFinished:Wait()
  274.                         task.wait(0.1)
  275.                     end
  276.                 end
  277.                 task.wait(0.1)
  278.             end
  279.             local character = player.Character
  280.             local humanoid = character and character:FindFirstChildOfClass("Humanoid")
  281.             if humanoid then
  282.                 humanoid.WalkSpeed = 16
  283.             end
  284.         end)
  285.     else
  286.         unblockJoystick()
  287.     end
  288. end)
  289.  
  290. local function saveOriginalProperties(obj)
  291.     if not originalProperties[obj] then
  292.         originalProperties[obj] = {
  293.             TextTransparency = obj:IsA("TextLabel") or obj:IsA("TextBox") or obj:IsA("TextButton") and obj.TextTransparency or nil,
  294.             BackgroundTransparency = obj:IsA("Frame") or obj:IsA("TextBox") or obj:IsA("TextButton") and obj.BackgroundTransparency or nil,
  295.             BackgroundColor3 = obj.BackgroundColor3
  296.         }
  297.     end
  298. end
  299.  
  300. local function fadeChildren(parent, targetTransparency, duration, callback)
  301.     for _, child in pairs(parent:GetDescendants()) do
  302.         if child:IsA("TextLabel") or child:IsA("TextBox") or child:IsA("TextButton") or child:IsA("Frame") then
  303.             saveOriginalProperties(child)
  304.             local props = {}
  305.             if originalProperties[child].TextTransparency ~= nil then
  306.                 props.TextTransparency = targetTransparency
  307.             end
  308.             if originalProperties[child].BackgroundTransparency ~= nil then
  309.                 props.BackgroundTransparency = targetTransparency
  310.             end
  311.             if targetTransparency < 1 then
  312.                 props.BackgroundColor3 = originalProperties[child].BackgroundColor3
  313.             end
  314.             TweenService:Create(child, TweenInfo.new(duration), props):Play()
  315.         end
  316.     end
  317.     task.delay(duration, function()
  318.         if callback then callback() end
  319.     end)
  320. end
  321.  
  322. minimizeButton.MouseButton1Click:Connect(function()
  323.     if not minimized then
  324.         fadeChildren(content, 1, 0.3, function()
  325.             local tween = TweenService:Create(frame, TweenInfo.new(0.4), {Size = UDim2.new(0, 240, 0, 25)})
  326.             tween:Play()
  327.             tween.Completed:Wait()
  328.             minimized = true
  329.             minimizeButton.Text = "O"
  330.         end)
  331.     else
  332.         frame.Active = true
  333.         local tween = TweenService:Create(frame, TweenInfo.new(0.4), {Size = UDim2.new(0, 240, 0, 140)})
  334.         tween:Play()
  335.         tween.Completed:Wait()
  336.         fadeChildren(content, 0, 0.3)
  337.         minimized = false
  338.         minimizeButton.Text = "X"
  339.     end
  340. end)
  341.  
  342. local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
  343. local fadeIn = TweenService:Create(frame, tweenInfo, {BackgroundTransparency = 0})
  344. frame.Visible = true
  345. fadeIn:Play()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement