-- GUI SETUP local screenGui = Instance.new("ScreenGui", game.Players.LocalPlayer:WaitForChild("PlayerGui")) screenGui.Name = "AutoPlayGui" screenGui.ResetOnSpawn = false local toggleMenuButton = Instance.new("TextButton") toggleMenuButton.Name = "ToggleMenuButton" toggleMenuButton.Parent = screenGui toggleMenuButton.Size = UDim2.new(0, 100, 0, 40) toggleMenuButton.Position = UDim2.new(0, 20, 0.5, -100) toggleMenuButton.Text = "≡" toggleMenuButton.TextScaled = true toggleMenuButton.BackgroundColor3 = Color3.fromRGB(40, 40, 40) toggleMenuButton.TextColor3 = Color3.fromRGB(255, 255, 255) toggleMenuButton.BorderSizePixel = 0 Instance.new("UICorner", toggleMenuButton).CornerRadius = UDim.new(0, 12) Instance.new("UIStroke", toggleMenuButton).Color = Color3.fromRGB(90, 90, 90) local mainFrame = Instance.new("Frame") mainFrame.Name = "MainFrame" mainFrame.Parent = screenGui mainFrame.Size = UDim2.new(0, 200, 0, 100) mainFrame.Position = UDim2.new(0, 140, 0.5, -60) mainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) mainFrame.Visible = false mainFrame.Active = true mainFrame.Draggable = true Instance.new("UICorner", mainFrame).CornerRadius = UDim.new(0, 16) Instance.new("UIStroke", mainFrame).Color = Color3.fromRGB(100, 100, 100) local autoplayButton = Instance.new("TextButton") autoplayButton.Name = "AutoplayButton" autoplayButton.Parent = mainFrame autoplayButton.Size = UDim2.new(0, 160, 0, 40) autoplayButton.Position = UDim2.new(0, 20, 0.5, -20) autoplayButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50) autoplayButton.TextColor3 = Color3.fromRGB(255, 255, 255) autoplayButton.TextScaled = true autoplayButton.Text = "AutoPlay: OFF" autoplayButton.BorderSizePixel = 0 Instance.new("UICorner", autoplayButton).CornerRadius = UDim.new(0, 10) Instance.new("UIStroke", autoplayButton).Color = Color3.fromRGB(80, 80, 80) toggleMenuButton.MouseButton1Click:Connect(function() mainFrame.Visible = not mainFrame.Visible end) -- SCRIPT LOGIC local AutoPlayEnabled = false autoplayButton.MouseButton1Click:Connect(function() AutoPlayEnabled = not AutoPlayEnabled autoplayButton.Text = AutoPlayEnabled and "AutoPlay: ON" or "AutoPlay: OFF" autoplayButton.BackgroundColor3 = AutoPlayEnabled and Color3.fromRGB(0, 170, 0) or Color3.fromRGB(50, 50, 50) end) -- AUTOPLAY BOT task.spawn(function() while true do if AutoPlayEnabled then -- The actual bot code begins here local PFS = game:GetService("PathfindingService") local VIM = game:GetService("VirtualInputManager") local Players = game:GetService("Players") local LP = Players.LocalPlayer local Camera = workspace.CurrentCamera local testPath = PFS:CreatePath({ AgentRadius = 2, AgentHeight = 5, AgentCanJump = false, AgentJumpHeight = 10, AgentCanClimb = true, AgentMaxSlope = 45 }) local isInGame, currentCharacter, humanoid, waypoints, counter = false, nil, nil, {}, 0 local stamina, busy, stopbreakingplease, isSprinting = 100, false, false, false local fail_attempt = 0 local lastYaw, roundStarted = nil, false local function resetBotState() currentCharacter = nil humanoid = nil waypoints = {} busy = false isSprinting = false fail_attempt = 0 end local function detectInGame() local Spectators = {} for _, child in ipairs(workspace.Players.Spectating:GetChildren()) do table.insert(Spectators, child.Name) end return not table.find(Spectators, LP.Name) end -- Sprint handler task.spawn(function() while AutoPlayEnabled do if isInGame and currentCharacter then pcall(function() currentCharacter.Humanoid:SetAttribute("BaseSpeed", 14) local barText = LP.PlayerGui.TemporaryUI.PlayerInfo.Bars.Stamina.Amount.Text stamina = tonumber(string.split(barText, "/")[1]) local isSprintingFOV = currentCharacter.FOVMultipliers.Sprinting.Value == 1.125 if not isSprintingFOV and stamina >= 70 and not busy then VIM:SendKeyEvent(true, Enum.KeyCode.LeftShift, false, game) end end) end wait(1) end end) -- Orientation check task.spawn(function() while AutoPlayEnabled do if isInGame and currentCharacter and currentCharacter:FindFirstChild("HumanoidRootPart") then local hrp = currentCharacter.HumanoidRootPart local currentYaw = math.deg(math.atan2(hrp.CFrame.LookVector.X, hrp.CFrame.LookVector.Z)) if lastYaw and math.abs(currentYaw - lastYaw) > 15 then VIM:SendKeyEvent(true, Enum.KeyCode.Q, false, game) wait(0.1) VIM:SendKeyEvent(false, Enum.KeyCode.Q, false, game) end lastYaw = currentYaw end wait(0.2) end end) local function isKillerNearby(radius) for _, killer in ipairs(workspace.Players.Killers:GetChildren()) do if killer:FindFirstChild("HumanoidRootPart") and currentCharacter then local dist = (killer.HumanoidRootPart.Position - currentCharacter.HumanoidRootPart.Position).Magnitude if dist <= radius then return killer end end end return nil end local function killerNotFacingYou(killer) if not killer or not currentCharacter then return false end local killerHRP = killer:FindFirstChild("HumanoidRootPart") local playerHRP = currentCharacter:FindFirstChild("HumanoidRootPart") if not killerHRP or not playerHRP then return false end local toPlayer = (playerHRP.Position - killerHRP.Position).Unit local killerLook = killerHRP.CFrame.LookVector.Unit local dot = killerLook:Dot(toPlayer) return dot < 0.5 end local function runFromKiller(killer) local fleeDirection = (-killer.HumanoidRootPart.CFrame.LookVector).Unit * 70 testPath:ComputeAsync(currentCharacter.HumanoidRootPart.Position, currentCharacter.HumanoidRootPart.Position + fleeDirection) if testPath.Status == Enum.PathStatus.Success then waypoints = testPath:GetWaypoints() humanoid = currentCharacter:WaitForChild("Humanoid") for _, wp in ipairs(waypoints) do if stopbreakingplease then break end local reached = false local conn = humanoid.MoveToFinished:Connect(function(s) reached = s end) humanoid:MoveTo(wp.Position) local start = os.clock() repeat wait(0.01) until reached or (os.clock() - start) >= 10 conn:Disconnect() end end end task.spawn(function() while AutoPlayEnabled do isInGame = detectInGame() if isInGame and not roundStarted then roundStarted = true VIM:SendKeyEvent(true, Enum.KeyCode.R, false, game) wait(0.1) VIM:SendKeyEvent(false, Enum.KeyCode.R, false, game) elseif not isInGame then roundStarted = false resetBotState() end if currentCharacter and currentCharacter:FindFirstChild("Humanoid") then if currentCharacter.Humanoid.Health <= 0 then resetBotState() end end wait(1) end end) while AutoPlayEnabled do if isInGame then if not currentCharacter then for _, surv in ipairs(workspace.Players.Survivors:GetChildren()) do if surv:GetAttribute("Username") == LP.Name then currentCharacter = surv break end end end if currentCharacter then local success = pcall(function() currentCharacter:WaitForChild("Humanoid", 5) currentCharacter:WaitForChild("HumanoidRootPart", 5) end) if not success then currentCharacter = nil wait(0.5) continue end else wait(0.5) continue end local killer = isKillerNearby(50) if killer then if killerNotFacingYou(killer) then VIM:SendKeyEvent(true, Enum.KeyCode.E, false, game) wait(0.1) VIM:SendKeyEvent(false, Enum.KeyCode.E, false, game) end runFromKiller(killer) else local closestGen, minDist = nil, math.huge for _, gen in ipairs(workspace.Map.Ingame:WaitForChild("Map"):GetChildren()) do if gen.Name == "Generator" and gen.Progress.Value < 100 then local goalPos = gen:WaitForChild("Positions").Right.Position local dist = (goalPos - currentCharacter.HumanoidRootPart.Position).Magnitude if dist < minDist then closestGen = gen minDist = dist end end end if closestGen then local goalPos = closestGen:WaitForChild("Positions").Right.Position testPath:ComputeAsync(currentCharacter.HumanoidRootPart.Position, goalPos) if testPath.Status == Enum.PathStatus.Success then waypoints = testPath:GetWaypoints() humanoid = currentCharacter:WaitForChild("Humanoid") for _, wp in ipairs(waypoints) do if stopbreakingplease or isKillerNearby(50) then break end local reached = false local conn = humanoid.MoveToFinished:Connect(function(s) reached = s end) humanoid:MoveTo(wp.Position) local start = os.clock() repeat wait(0.01) until reached or (os.clock() - start) >= 10 conn:Disconnect() end local prompt = closestGen.Main:FindFirstChild("Prompt") if prompt and not isKillerNearby(50) then prompt.HoldDuration = 0 prompt.RequiresLineOfSight = false prompt.MaxActivationDistance = 99999 wait(0.1) busy = true counter = 0 while closestGen.Progress.Value < 100 and isInGame and not isKillerNearby(50) do local head = currentCharacter:FindFirstChild("Head") if head then local direction = (goalPos - head.Position).Unit Camera.CFrame = CFrame.new(head.Position, head.Position + direction) end prompt:InputHoldBegin() prompt:InputHoldEnd() closestGen.Remotes.RE:FireServer() wait(2.5) counter += 1 if counter >= 10 then break end end busy = false counter = 0 end end end end end wait(0.1) end else wait(0.2) end end end)