return
end
local killer=getKiller()
if local Players=game:GetService("Players")
local PathfindingService=game:GetService("PathfindingService")
local RunService=game:GetService("RunService")
local localPlayer=Players.LocalPlayer
local character=localPlayer.Character or localPlayer.CharacterAdded:Wait()
local humanoid=character:WaitForChild("Humanoid")
local rootPart=character:WaitForChild("HumanoidRootPart")
local safeDistance=60
local staminaThreshold=30
local sprintSpeed=20
local walkSpeed=12
local staminaName="Stamina"
local autoRunEnabled=false
local screenGui=Instance.new("ScreenGui")
screenGui.Name="ForsakenAutoRunGui"
screenGui.ResetOnSpawn=false
screenGui.Parent=localPlayer:WaitForChild("PlayerGui")
local frame=Instance.new("Frame")
frame.Size=UDim2.new(0,220,0,140)
frame.Position=UDim2.new(0,10,0,50)
frame.BackgroundColor3=Color3.fromRGB(30,30,30)
frame.BorderSizePixel=0
frame.Parent=screenGui
local toggleButton=Instance.new("TextButton")
toggleButton.Size=UDim2.new(0,200,0,40)
toggleButton.Position=UDim2.new(0,10,0,10)
toggleButton.BackgroundColor3=Color3.fromRGB(50,50,50)
toggleButton.TextColor3=Color3.new(1,1,1)
toggleButton.Font=Enum.Font.SourceSansBold
toggleButton.TextSize=22
toggleButton.Text="Enable Auto Run"
toggleButton.Parent=frame
local staminaLabel=Instance.new("TextLabel")
staminaLabel.Size=UDim2.new(0,200,0,25)
staminaLabel.Position=UDim2.new(0,10,0,60)
staminaLabel.BackgroundTransparency=1
staminaLabel.TextColor3=Color3.new(1,1,1)
staminaLabel.Font=Enum.Font.SourceSans
staminaLabel.TextSize=20
staminaLabel.Text="Stamina: N/A"
staminaLabel.Parent=frame
local distanceLabel=Instance.new("TextLabel")
distanceLabel.Size=UDim2.new(0,200,0,25)
distanceLabel.Position=UDim2.new(0,10,0,85)
distanceLabel.BackgroundTransparency=1
distanceLabel.TextColor3=Color3.new(1,1,1)
distanceLabel.Font=Enum.Font.SourceSans
distanceLabel.TextSize=20
distanceLabel.Text="Distance to Killer: N/A"
distanceLabel.Parent=frame
local speedLabel=Instance.new("TextLabel")
speedLabel.Size=UDim2.new(0,200,0,25)
speedLabel.Position=UDim2.new(0,10,0,110)
speedLabel.BackgroundTransparency=1
speedLabel.TextColor3=Color3.new(1,1,1)
speedLabel.Font=Enum.Font.SourceSans
speedLabel.TextSize=20
speedLabel.Text="Speed Mode: Idle"
speedLabel.Parent=frame
local function getKiller()
return workspace:FindFirstChild("Killer")
end
local function getStaminaPercent()
local stamina=humanoid:FindFirstChild(staminaName)
if stamina then
return stamina.Value/stamina.MaxValue*100
else
return 100
end
end
local function moveToPosition(targetPos)
local path=PathfindingService:CreatePath()
path:ComputeAsync(rootPart.Position,targetPos)
if path.Status==Enum.PathStatus.Success then
local waypoints=path:GetWaypoints()
for i,waypoint in ipairs(waypoints) do
humanoid:MoveTo(waypoint.Position)
local reached=humanoid.MoveToFinished:Wait()
if not reached then break end
end
return true
else
return false
end
end
local function findSafePosition(killerPos)
local direction=(rootPart.Position-killerPos).Unit
for dist=safeDistance,safeDistance+50,10 do
local candidatePos=rootPart.Position+direction*dist
local success=moveToPosition(candidatePos)
if success then return candidatePos end
end
return nil
end
toggleButton.MouseButton1Click:Connect(function()
autoRunEnabled=not autoRunEnabled
toggleButton.Text=autoRunEnabled and "Disable Auto Run" or "Enable Auto Run"
if not autoRunEnabled then
humanoid.WalkSpeed=walkSpeed
humanoid:MoveTo(rootPart.Position)
end
end)
RunService.Heartbeat:Connect(function()
if not autoRunEnabled then
staminaLabel.Text="Stamina: N/A"
distanceLabel.Text="Distance to Killer: N/A"
speedLabel.Text="Speed Mode: Idle"
return
end
local killer=getKiller()
if not killer or not killer:FindFirstChild("HumanoidRootPart") then
staminaLabel.Text="Stamina: N/A"
distanceLabel.Text="Distance to Killer: N/A"
speedLabel.Text="Speed Mode: No Killer Found"
return
end
local killerPos=killer.HumanoidRootPart.Position
local distToKiller=(rootPart.Position-killerPos).Magnitude
distanceLabel.Text=string.format("Distance to Killer: %.1f",distToKiller)
local staminaPercent=getStaminaPercent()
staminaLabel.Text=string.format("Stamina: %.1f%%",staminaPercent)
if distToKillerstaminaThreshold then
humanoid.WalkSpeed=sprintSpeed
speedLabel.Text="Speed Mode: Sprinting"
else
humanoid.WalkSpeed=walkSpeed
speedLabel.Text="Speed Mode: Walking"
end
local safePos=findSafePosition(killerPos)
if safePos then
humanoid:MoveTo(safePos)
else
local escapePos=rootPart.Position+(rootPart.Position-killerPos).Unit*safeDistance
humanoid:MoveTo(escapePos)
end
else
humanoid.WalkSpeed=walkSpeed/2
speedLabel.Text="Speed Mode: Recovering"
end
end)