Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Made by Muscle_legends2021 [update: moved the toggle button to left cus you could not click on it while you were sparring.]
- local speedFarmToggle = false
- local weightFarmToggle = false
- local accuracyFarmToggle = false
- local uiVisible = true
- local player = game.Players.LocalPlayer
- local function createGUI()
- -- Check if GUI already exists
- if player.PlayerGui:FindFirstChild("ToggleGui") then
- player.PlayerGui.ToggleGui:Destroy()
- end
- -- Create ScreenGui
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "ToggleGui"
- screenGui.ResetOnSpawn = false
- screenGui.Parent = player.PlayerGui
- -- Function to style buttons
- local function styleButton(button)
- button.Font = Enum.Font.GothamBold
- button.TextSize = 24
- button.TextScaled = true
- button.TextWrapped = true
- end
- -- SpeedFarm Button
- local speedFarmButton = Instance.new("TextButton")
- speedFarmButton.Size = UDim2.new(0, 250, 0, 50)
- speedFarmButton.Position = UDim2.new(0.58, 0, 0.5, -115)
- speedFarmButton.Text = "SpeedFarm: OFF"
- speedFarmButton.BackgroundColor3 = Color3.fromRGB(120, 120, 120)
- speedFarmButton.Visible = uiVisible
- speedFarmButton.Parent = screenGui
- styleButton(speedFarmButton)
- -- WeightFarm Button
- local weightFarmButton = Instance.new("TextButton")
- weightFarmButton.Size = UDim2.new(0, 250, 0, 50)
- weightFarmButton.Position = UDim2.new(0.58, 0, 0.5, -50)
- weightFarmButton.Text = "WeightFarm: OFF"
- weightFarmButton.BackgroundColor3 = Color3.fromRGB(120, 120, 120)
- weightFarmButton.Visible = uiVisible
- weightFarmButton.Parent = screenGui
- styleButton(weightFarmButton)
- -- AccuracyFarm Button
- local accuracyFarmButton = Instance.new("TextButton")
- accuracyFarmButton.Size = UDim2.new(0, 250, 0, 50)
- accuracyFarmButton.Position = UDim2.new(0.58, 0, 0.5, 15)
- accuracyFarmButton.Text = "AccuracyFarm: OFF"
- accuracyFarmButton.BackgroundColor3 = Color3.fromRGB(120, 120, 120)
- accuracyFarmButton.Visible = uiVisible
- accuracyFarmButton.Parent = screenGui
- styleButton(accuracyFarmButton)
- -- Toggle Button
- local toggleUIVisibilityButton = Instance.new("TextButton")
- toggleUIVisibilityButton.Size = UDim2.new(0, 50, 0, 50)
- toggleUIVisibilityButton.Position = UDim2.new(0.02, 55, 0.5, -25) -- Move to the left and shift 55 pixels to the right
- toggleUIVisibilityButton.Text = "≡"
- toggleUIVisibilityButton.BackgroundColor3 = Color3.fromRGB(139, 0, 0)
- toggleUIVisibilityButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- toggleUIVisibilityButton.Parent = screenGui
- styleButton(toggleUIVisibilityButton)
- -- Toggle SpeedFarm
- local function toggleSpeedFarm()
- speedFarmToggle = not speedFarmToggle
- speedFarmButton.Text = speedFarmToggle and "SpeedFarm: ON" or "SpeedFarm: OFF"
- speedFarmButton.BackgroundColor3 = speedFarmToggle and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(120, 120, 120)
- if speedFarmToggle then
- spawn(function()
- while speedFarmToggle do
- wait()
- local punchbag1 = workspace.Punch_Bag1
- local punchbag2 = workspace.Punch_Bag2
- local speedbag1 = workspace.Speed_Bag1
- local speedbag2 = workspace.Speed_Bag2
- local using = 0
- if punchbag1.In_Use.Value == false then
- player.Character.HumanoidRootPart.CFrame = punchbag1.Torso_Position.CFrame
- wait(0.75)
- game.ReplicatedStorage.Strength_Exercises["Punch_Bag1"]:FireServer()
- using = 1
- elseif punchbag2.In_Use.Value == false then
- player.Character.HumanoidRootPart.CFrame = punchbag2.Torso_Position.CFrame
- wait(0.75)
- game.ReplicatedStorage.Strength_Exercises["Punch_Bag2"]:FireServer()
- using = 2
- elseif speedbag1.In_Use.Value == false then
- player.Character.HumanoidRootPart.CFrame = speedbag1.Torso_Position.CFrame
- wait(0.75)
- game.ReplicatedStorage.Strength_Exercises["Speed_Bag1"]:FireServer()
- using = 3
- elseif speedbag2.In_Use.Value == false then
- player.Character.HumanoidRootPart.CFrame = speedbag2.Torso_Position.CFrame
- wait(0.75)
- game.ReplicatedStorage.Strength_Exercises["Speed_Bag1"]:FireServer()
- using = 4
- end
- if using == 1 then repeat wait(0.1) until punchbag1.Player.Value ~= player.Name end
- if using == 2 then repeat wait(0.1) until punchbag2.Player.Value ~= player.Name end
- if using == 3 then repeat wait(0.1) until speedbag1.Player.Value ~= player.Name end
- if using == 4 then repeat wait(0.1) until speedbag2.Player.Value ~= player.Name end
- using = 0
- end
- end)
- end
- end
- -- Toggle WeightFarm
- local function toggleWeightFarm()
- weightFarmToggle = not weightFarmToggle
- weightFarmButton.Text = weightFarmToggle and "WeightFarm: ON" or "WeightFarm: OFF"
- weightFarmButton.BackgroundColor3 = weightFarmToggle and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(120, 120, 120)
- if weightFarmToggle then
- spawn(function()
- while weightFarmToggle do
- wait()
- local overhead1 = workspace.Overhead1
- local bicep1 = workspace.Bicep1
- local squat1 = workspace.Squat1
- local bench1 = workspace.Bench1
- local using = 0
- if overhead1.In_Use.Value == false then
- player.Character.HumanoidRootPart.CFrame = overhead1.Torso_Position.CFrame
- wait(0.75)
- game.ReplicatedStorage.Strength_Exercises["Overhead1"]:FireServer()
- using = 1
- elseif bicep1.In_Use.Value == false then
- player.Character.HumanoidRootPart.CFrame = bicep1.Torso_Position.CFrame
- wait(0.75)
- game.ReplicatedStorage.Strength_Exercises["Bicep1"]:FireServer()
- using = 2
- elseif squat1.In_Use.Value == false then
- player.Character.HumanoidRootPart.CFrame = squat1.Torso_Position.CFrame
- wait(0.75)
- game.ReplicatedStorage.Strength_Exercises["Squat1"]:FireServer()
- using = 3
- elseif bench1.In_Use.Value == false then
- player.Character.HumanoidRootPart.CFrame = bench1.Torso_Position.CFrame
- wait(0.75)
- game.ReplicatedStorage.Strength_Exercises["Bench1"]:FireServer()
- using = 4
- end
- if using == 1 then repeat wait(0.1) until overhead1.Player.Value ~= player.Name end
- if using == 2 then repeat wait(0.1) until bicep1.Player.Value ~= player.Name end
- if using == 3 then repeat wait(0.1) until squat1.Player.Value ~= player.Name end
- if using == 4 then repeat wait(0.1) until bench1.Player.Value ~= player.Name end
- using = 0
- end
- end)
- end
- end
- -- Toggle AccuracyFarm
- local function toggleAccuracyFarm()
- accuracyFarmToggle = not accuracyFarmToggle
- accuracyFarmButton.Text = accuracyFarmToggle and "AccuracyFarm: ON" or "AccuracyFarm: OFF"
- accuracyFarmButton.BackgroundColor3 = accuracyFarmToggle and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(120, 120, 120)
- if accuracyFarmToggle then
- spawn(function()
- while accuracyFarmToggle do
- wait()
- local num = 1
- for i = 1, 4 do
- local dummy = workspace["Dummy_Punch" .. i]
- if not dummy.In_Use.Value then
- num = i
- break
- end
- end
- local dummy = workspace["Dummy_Punch" .. num]
- player.Character.HumanoidRootPart.CFrame = dummy.BlockedArea1.CFrame
- wait(0.75)
- game.ReplicatedStorage.Strength_Exercises["Dummy_Punch" .. num]:FireServer()wait(0.75)
- repeat
- wait(0.1)
- local playerName = dummy.Player.Value
- local buttons = dummy.Buttons:GetChildren()
- for _, button in ipairs(buttons) do
- if button.Color == Color3.fromRGB(0, 255, 0) then
- fireclickdetector(button.ClickDetector)
- end
- end
- until dummy.Player.Value ~= player.Name
- end
- end)
- end
- end
- -- Connect buttons to their functions
- speedFarmButton.MouseButton1Click:Connect(toggleSpeedFarm)
- weightFarmButton.MouseButton1Click:Connect(toggleWeightFarm)
- accuracyFarmButton.MouseButton1Click:Connect(toggleAccuracyFarm)
- -- Toggle UI visibility
- toggleUIVisibilityButton.MouseButton1Click:Connect(function()
- uiVisible = not uiVisible
- speedFarmButton.Visible = uiVisible
- weightFarmButton.Visible = uiVisible
- accuracyFarmButton.Visible = uiVisible
- end)
- end
- -- Create GUI
- createGUI()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement