DH hub-vinqdevelopment2 (PRE-ALPHA 1.0)
Key Required

DH hub-vinqdevelopment2 (PRE-ALPHA 1.0)

[V0.2 PRE-ALPHA] Darkest Hoursvinqdevelops2vinqdevelops2 578 views 432 executesUpdated Oct 4, 2026
Unrated
00
Lua Script•1628 lines (60334 chars)
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Lighting = game:GetService("Lighting")
local Workspace = game:GetService("Workspace")
local CoreGui = game:GetService("CoreGui")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local LocalPlayer = Players.LocalPlayer or Players.PlayerAdded:Wait()

-- Locate SharedCharacter module for Stamina Bypass
local SharedCharacter = nil
pcall(function()
    SharedCharacter = require(ReplicatedStorage:WaitForChild("Shared", 3):WaitForChild("Classes", 3):WaitForChild("SharedCharacter", 3))
end)

local OriginalDepleteStamina = nil
if SharedCharacter and type(SharedCharacter.DepleteStamina) == "function" then
    OriginalDepleteStamina = SharedCharacter.DepleteStamina
end

-- Configuration for Revive Aura
local maxDistance = 15

-- Attempt to locate the Downed module inside ReplicatedStorage.Shared.Downed
local DownedModule = nil
local SharedFolder = ReplicatedStorage:FindFirstChild("Shared")
if SharedFolder then
    DownedModule = SharedFolder:FindFirstChild("Downed")
end

local function GetSafeParent()
    if gethui then return gethui() end
    if syn and syn.protect_gui then
        local f = Instance.new("Folder")
        syn.protect_gui(f)
        f.Parent = CoreGui
        return f
    end
    return CoreGui
end

local TargetParent = GetSafeParent()
local existing = TargetParent:FindFirstChild("DH_Hub_PreAlpha") or LocalPlayer:WaitForChild("PlayerGui"):FindFirstChild("DH_Hub_PreAlpha")
if existing then existing:Destroy() end

local MainGui = Instance.new("ScreenGui")
MainGui.Name = "DH_Hub_PreAlpha"
MainGui.ResetOnSpawn = false
MainGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
MainGui.Parent = TargetParent

local MainFrame = Instance.new("Frame")
MainFrame.Name = "MainFrame"
MainFrame.Size = UDim2.new(0, 850, 0, 540)
MainFrame.Position = UDim2.new(0.5, -425, 0.5, -270)
MainFrame.BackgroundColor3 = Color3.fromRGB(15, 15, 20)
MainFrame.BorderSizePixel = 0
MainFrame.ClipsDescendants = true
MainFrame.Parent = MainGui

local FrameCorner = Instance.new("UICorner")
FrameCorner.CornerRadius = UDim.new(0, 8)
FrameCorner.Parent = MainFrame

local FrameStroke = Instance.new("UIStroke")
FrameStroke.Color = Color3.fromRGB(120, 80, 255)
FrameStroke.Thickness = 1.5
FrameStroke.Parent = MainFrame

local TopBar = Instance.new("Frame")
TopBar.Size = UDim2.new(1, 0, 0, 42)
TopBar.BackgroundColor3 = Color3.fromRGB(22, 22, 28)
TopBar.BorderSizePixel = 0
TopBar.Parent = MainFrame

local TitleLabel = Instance.new("TextLabel")
TitleLabel.Size = UDim2.new(0, 400, 1, 0)
TitleLabel.Position = UDim2.new(0, 14, 0, 0)
TitleLabel.BackgroundTransparency = 1
TitleLabel.Font = Enum.Font.GothamBold
TitleLabel.Text = "darkest hours hub - pre-alpha 1.0"
TitleLabel.TextColor3 = Color3.fromRGB(245, 245, 250)
TitleLabel.TextSize = 13
TitleLabel.TextXAlignment = Enum.TextXAlignment.Left
TitleLabel.Parent = TopBar

local Dragging, DragInput, DragStart, StartPos
TopBar.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        Dragging = true
        DragStart = input.Position
        StartPos = MainFrame.Position
    end
end)

TopBar.InputChanged:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
        DragInput = input
    end
end)

UserInputService.InputChanged:Connect(function(input)
    if input == DragInput and Dragging then
        local Delta = input.Position - DragStart
        MainFrame.Position = UDim2.new(StartPos.X.Scale, StartPos.X.Offset + Delta.X, StartPos.Y.Scale, StartPos.Y.Offset + Delta.Y)
    end
end)

UserInputService.InputEnded:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        Dragging = false
    end
end)

local NotificationContainer = Instance.new("Frame")
NotificationContainer.Size = UDim2.new(0, 260, 1, -20)
NotificationContainer.Position = UDim2.new(1, -270, 0, 10)
NotificationContainer.BackgroundTransparency = 1
NotificationContainer.Parent = MainGui

local NotificationLayout = Instance.new("UIListLayout")
NotificationLayout.SortOrder = Enum.SortOrder.LayoutOrder
NotificationLayout.VerticalAlignment = Enum.VerticalAlignment.Bottom
NotificationLayout.Padding = UDim.new(0, 6)
NotificationLayout.Parent = NotificationContainer

local function Notify(title, msg)
    local Toast = Instance.new("Frame")
    Toast.Size = UDim2.new(1, 0, 0, 48)
    Toast.BackgroundColor3 = Color3.fromRGB(24, 24, 32)
    Toast.BorderSizePixel = 0
    Toast.Parent = NotificationContainer

    local ToastCorner = Instance.new("UICorner")
    ToastCorner.CornerRadius = UDim.new(0, 6)
    ToastCorner.Parent = Toast

    local ToastStroke = Instance.new("UIStroke")
    ToastStroke.Color = Color3.fromRGB(120, 80, 255)
    ToastStroke.Thickness = 1
    ToastStroke.Parent = Toast

    local TTitle = Instance.new("TextLabel")
    TTitle.Size = UDim2.new(1, -10, 0, 18)
    TTitle.Position = UDim2.new(0, 10, 0, 4)
    TTitle.BackgroundTransparency = 1
    TTitle.Font = Enum.Font.GothamBold
    TTitle.Text = title:lower()
    TTitle.TextColor3 = Color3.fromRGB(120, 80, 255)
    TTitle.TextSize = 11
    TTitle.TextXAlignment = Enum.TextXAlignment.Left
    TTitle.Parent = Toast

    local TMsg = Instance.new("TextLabel")
    TMsg.Size = UDim2.new(1, -10, 0, 22)
    TMsg.Position = UDim2.new(0, 10, 0, 20)
    TMsg.BackgroundTransparency = 1
    TMsg.Font = Enum.Font.Gotham
    TMsg.Text = msg:lower()
    TMsg.TextColor3 = Color3.fromRGB(220, 220, 230)
    TMsg.TextSize = 11
    TMsg.TextXAlignment = Enum.TextXAlignment.Left
    TMsg.Parent = Toast

    task.delay(4, function()
        if Toast and Toast.Parent then
            TweenService:Create(Toast, TweenInfo.new(0.3), {BackgroundTransparency = 1}):Play()
            task.wait(0.3)
            Toast:Destroy()
        end
    end)
end

local MainScroll = Instance.new("ScrollingFrame")
MainScroll.Size = UDim2.new(1, -24, 1, -52)
MainScroll.Position = UDim2.new(0, 12, 0, 46)
MainScroll.BackgroundTransparency = 1
MainScroll.BorderSizePixel = 0
MainScroll.ScrollBarThickness = 4
MainScroll.ScrollBarImageColor3 = Color3.fromRGB(80, 80, 100)
MainScroll.Parent = MainFrame

local ScrollLayout = Instance.new("UIListLayout")
ScrollLayout.SortOrder = Enum.SortOrder.LayoutOrder
ScrollLayout.Padding = UDim.new(0, 10)
ScrollLayout.Parent = MainScroll

ScrollLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
    MainScroll.CanvasSize = UDim2.new(0, 0, 0, ScrollLayout.AbsoluteContentSize.Y + 20)
end)

local function CreateHeader(text)
    local Label = Instance.new("TextLabel")
    Label.Size = UDim2.new(1, 0, 0, 22)
    Label.BackgroundTransparency = 1
    Label.Font = Enum.Font.GothamBold
    Label.Text = text:lower()
    Label.TextColor3 = Color3.fromRGB(120, 80, 255)
    Label.TextSize = 12
    Label.TextXAlignment = Enum.TextXAlignment.Left
    Label.Parent = MainScroll
end

local function CreateToggle(title, defaultState, callback)
    local ToggleFrame = Instance.new("Frame")
    ToggleFrame.Size = UDim2.new(1, 0, 0, 38)
    ToggleFrame.BackgroundColor3 = Color3.fromRGB(22, 22, 28)
    ToggleFrame.Parent = MainScroll

    local Corner = Instance.new("UICorner")
    Corner.CornerRadius = UDim.new(0, 5)
    Corner.Parent = ToggleFrame

    local Label = Instance.new("TextLabel")
    Label.Size = UDim2.new(1, -55, 1, 0)
    Label.Position = UDim2.new(0, 10, 0, 0)
    Label.BackgroundTransparency = 1
    Label.Font = Enum.Font.Gotham
    Label.Text = title:lower()
    Label.TextColor3 = Color3.fromRGB(220, 220, 230)
    Label.TextSize = 11
    Label.TextXAlignment = Enum.TextXAlignment.Left
    Label.Parent = ToggleFrame

    local Switch = Instance.new("Frame")
    Switch.Size = UDim2.new(0, 36, 0, 18)
    Switch.Position = UDim2.new(1, -46, 0.5, -9)
    Switch.BackgroundColor3 = defaultState and Color3.fromRGB(120, 80, 255) or Color3.fromRGB(45, 45, 55)
    Switch.Parent = ToggleFrame

    local SwitchCorner = Instance.new("UICorner")
    SwitchCorner.CornerRadius = UDim.new(1, 0)
    SwitchCorner.Parent = Switch

    local Circle = Instance.new("Frame")
    Circle.Size = UDim2.new(0, 14, 0, 14)
    Circle.Position = defaultState and UDim2.new(1, -16, 0.5, -7) or UDim2.new(0, 2, 0.5, -7)
    Circle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
    Circle.Parent = Switch

    local CircleCorner = Instance.new("UICorner")
    CircleCorner.CornerRadius = UDim.new(1, 0)
    CircleCorner.Parent = Circle

    local State = defaultState
    local Button = Instance.new("TextButton")
    Button.Size = UDim2.new(1, 0, 1, 0)
    Button.BackgroundTransparency = 1
    Button.Text = ""
    Button.Parent = ToggleFrame

    Button.MouseButton1Click:Connect(function()
        State = not State
        TweenService:Create(Switch, TweenInfo.new(0.18), {BackgroundColor3 = State and Color3.fromRGB(120, 80, 255) or Color3.fromRGB(45, 45, 55)}):Play()
        TweenService:Create(Circle, TweenInfo.new(0.18), {Position = State and UDim2.new(1, -16, 0.5, -7) or UDim2.new(0, 2, 0.5, -7)}):Play()
        callback(State)
    end)
end

local function CreateButton(title, callback)
    local ButtonFrame = Instance.new("TextButton")
    ButtonFrame.Size = UDim2.new(1, 0, 0, 36)
    ButtonFrame.BackgroundColor3 = Color3.fromRGB(28, 28, 36)
    ButtonFrame.Font = Enum.Font.GothamMedium
    ButtonFrame.Text = title:lower()
    ButtonFrame.TextColor3 = Color3.fromRGB(230, 230, 240)
    ButtonFrame.TextSize = 11
    ButtonFrame.Parent = MainScroll

    local Corner = Instance.new("UICorner")
    Corner.CornerRadius = UDim.new(0, 5)
    Corner.Parent = ButtonFrame

    ButtonFrame.MouseButton1Click:Connect(function()
        TweenService:Create(ButtonFrame, TweenInfo.new(0.1), {BackgroundColor3 = Color3.fromRGB(120, 80, 255)}):Play()
        task.wait(0.1)
        TweenService:Create(ButtonFrame, TweenInfo.new(0.15), {BackgroundColor3 = Color3.fromRGB(28, 28, 36)}):Play()
        callback()
    end)
    return ButtonFrame
end

local function CreateSlider(title, min, max, default, callback)
    local SliderFrame = Instance.new("Frame")
    SliderFrame.Size = UDim2.new(1, 0, 0, 46)
    SliderFrame.BackgroundColor3 = Color3.fromRGB(22, 22, 28)
    SliderFrame.Parent = MainScroll

    local Corner = Instance.new("UICorner")
    Corner.CornerRadius = UDim.new(0, 5)
    Corner.Parent = SliderFrame

    local Label = Instance.new("TextLabel")
    Label.Size = UDim2.new(0.7, 0, 0, 22)
    Label.Position = UDim2.new(0, 10, 0, 2)
    Label.BackgroundTransparency = 1
    Label.Font = Enum.Font.Gotham
    Label.Text = title:lower()
    Label.TextColor3 = Color3.fromRGB(220, 220, 230)
    Label.TextSize = 11
    Label.TextXAlignment = Enum.TextXAlignment.Left
    Label.Parent = SliderFrame

    local ValLabel = Instance.new("TextLabel")
    ValLabel.Size = UDim2.new(0.3, -10, 0, 22)
    ValLabel.Position = UDim2.new(0.7, 0, 0, 2)
    ValLabel.BackgroundTransparency = 1
    ValLabel.Font = Enum.Font.GothamBold
    ValLabel.Text = tostring(default)
    ValLabel.TextColor3 = Color3.fromRGB(120, 80, 255)
    ValLabel.TextSize = 11
    ValLabel.TextXAlignment = Enum.TextXAlignment.Right
    ValLabel.Parent = SliderFrame

    local Track = Instance.new("Frame")
    Track.Size = UDim2.new(1, -20, 0, 5)
    Track.Position = UDim2.new(0, 10, 0, 30)
    Track.BackgroundColor3 = Color3.fromRGB(45, 45, 55)
    Track.Parent = SliderFrame

    local Fill = Instance.new("Frame")
    Fill.Size = UDim2.new((default - min) / (max - min), 0, 1, 0)
    Fill.BackgroundColor3 = Color3.fromRGB(120, 80, 255)
    Fill.Parent = Track

    local Active = false
    local function Update(input)
        local Relative = math.clamp((input.Position.X - Track.AbsolutePosition.X) / Track.AbsoluteSize.X, 0, 1)
        local Value = math.floor(min + (max - min) * Relative)
        Fill.Size = UDim2.new(Relative, 0, 1, 0)
        ValLabel.Text = tostring(Value)
        callback(Value)
    end

    Track.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
            Active = true
            Update(input)
        end
    end)
    UserInputService.InputEnded:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
            Active = false
        end
    end)
    UserInputService.InputChanged:Connect(function(input)
        if Active and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
            Update(input)
        end
    end)
end

local function SmoothMoveTo(targetCFrame, speed)
    local char = LocalPlayer.Character
    local hrp = char and char:FindFirstChild("HumanoidRootPart")
    if not hrp then return end

    local dist = (hrp.Position - targetCFrame.Position).Magnitude
    local duration = math.max(0.01, dist / (speed or 85))

    local tweenInfo = TweenInfo.new(duration, Enum.EasingStyle.Linear)
    local tween = TweenService:Create(hrp, tweenInfo, {CFrame = targetCFrame})
    tween:Play()
    tween.Completed:Wait()
end

local function GetAllEntities()
    local entities = {}
    local searchedContainers = {
        Workspace:FindFirstChild("Entities"),
        Workspace:FindFirstChild("Monsters"),
        Workspace:FindFirstChild("Spawns"),
        Workspace
    }

    local function ScanContainer(container)
        if not container then return end
        for _, item in ipairs(container:GetChildren()) do
            if item:IsA("Model") then
                if item:FindFirstChildOfClass("Humanoid") or item:FindFirstChild("HumanoidRootPart") or item:FindFirstChild("Head") then
                    if not Players:GetPlayerFromCharacter(item) then
                        table.insert(entities, item)
                    end
                else
                    ScanContainer(item)
                end
            elseif item:IsA("Folder") then
                ScanContainer(item)
            elseif item:IsA("BasePart") and item.Name:lower():find("monster") then
                table.insert(entities, item)
            end
        end
    end

    for _, c in ipairs(searchedContainers) do
        if c then ScanContainer(c) end
    end

    local unique = {}
    local hash = {}
    for _, ent in ipairs(entities) do
        if not hash[ent] then
            hash[ent] = true
            table.insert(unique, ent)
        end
    end

    return unique
end

CreateHeader("monster showcase")

local ShowcaseFrame = Instance.new("Frame")
ShowcaseFrame.Size = UDim2.new(1, 0, 0, 240)
ShowcaseFrame.BackgroundColor3 = Color3.fromRGB(12, 12, 16)
ShowcaseFrame.Parent = MainScroll

local ShowcaseCorner = Instance.new("UICorner")
ShowcaseCorner.CornerRadius = UDim.new(0, 6)
ShowcaseCorner.Parent = ShowcaseFrame

local Viewport = Instance.new("ViewportFrame")
Viewport.Size = UDim2.new(1, -220, 1, -10)
Viewport.Position = UDim2.new(0, 5, 0, 5)
Viewport.BackgroundColor3 = Color3.fromRGB(8, 8, 12)
Viewport.Parent = ShowcaseFrame

local ViewportCorner = Instance.new("UICorner")
ViewportCorner.CornerRadius = UDim.new(0, 5)
ViewportCorner.Parent = Viewport

local ViewportWorld = Instance.new("WorldModel")
ViewportWorld.Parent = Viewport

local ViewportCamera = Instance.new("Camera")
Viewport.CurrentCamera = ViewportCamera
ViewportCamera.Parent = Viewport

local ViewportLight = Instance.new("PointLight")
ViewportLight.Color = Color3.fromRGB(255, 255, 255)
ViewportLight.Range = 60
ViewportLight.Brightness = 2

local MonsterListFrame = Instance.new("ScrollingFrame")
MonsterListFrame.Size = UDim2.new(0, 205, 1, -10)
MonsterListFrame.Position = UDim2.new(1, -210, 0, 5)
MonsterListFrame.BackgroundColor3 = Color3.fromRGB(18, 18, 24)
MonsterListFrame.BorderSizePixel = 0
MonsterListFrame.ScrollBarThickness = 3
MonsterListFrame.Parent = ShowcaseFrame

local MonsterListCorner = Instance.new("UICorner")
MonsterListCorner.CornerRadius = UDim.new(0, 5)
MonsterListCorner.Parent = MonsterListFrame

local MonsterListLayout = Instance.new("UIListLayout")
MonsterListLayout.SortOrder = Enum.SortOrder.LayoutOrder
MonsterListLayout.Padding = UDim.new(0, 4)
MonsterListLayout.Parent = MonsterListFrame

MonsterListLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
    MonsterListFrame.CanvasSize = UDim2.new(0, 0, 0, MonsterListLayout.AbsoluteContentSize.Y + 5)
end)

local CurrentPreviewClone = nil
local RotateAngle = 0

local function ClearPreview()
    ViewportWorld:ClearAllChildren()
    CurrentPreviewClone = nil
end

local function LoadMonsterInPreview(monsterModel)
    ClearPreview()
    if not monsterModel or not (monsterModel:IsA("Model") or monsterModel:IsA("BasePart")) then return end

    local clone = monsterModel:Clone()
    for _, scriptObj in ipairs(clone:GetDescendants()) do
        if scriptObj:IsA("LuaSourceContainer") then scriptObj:Destroy() end
    end

    clone.Parent = ViewportWorld
    CurrentPreviewClone = clone

    local primary = clone:IsA("BasePart") and clone or (clone.PrimaryPart or clone:FindFirstChild("HumanoidRootPart") or clone:FindFirstChild("Head") or clone:FindFirstChildWhichIsA("BasePart"))
    if primary then
        if clone:IsA("Model") then
            local humanoid = clone:FindFirstChildOfClass("Humanoid") or Instance.new("Humanoid", clone)
            local animator = humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", humanoid)

            local origAnim = monsterModel:FindFirstChildOfClass("Animation") or monsterModel:FindFirstChild("Run") or monsterModel:FindFirstChild("Walk")
            if origAnim and origAnim:IsA("Animation") then
                local track = animator:LoadAnimation(origAnim)
                track.Looped = true
                track:Play()
            end
        end
        ViewportLight.Parent = primary
    end
end

RunService.RenderStepped:Connect(function()
    if CurrentPreviewClone then
        local primary = CurrentPreviewClone:IsA("BasePart") and CurrentPreviewClone or (CurrentPreviewClone.PrimaryPart or CurrentPreviewClone:FindFirstChild("HumanoidRootPart") or CurrentPreviewClone:FindFirstChild("Head") or CurrentPreviewClone:FindFirstChildWhichIsA("BasePart"))
        if primary then
            RotateAngle = RotateAngle + 0.015
            local dist = 10
            local x = primary.Position.X + math.cos(RotateAngle) * dist
            local z = primary.Position.Z + math.sin(RotateAngle) * dist
            ViewportCamera.CFrame = CFrame.new(Vector3.new(x, primary.Position.Y + 2, z), primary.Position)
        end
    end
end)

local function PopulateMonsterShowcase()
    for _, c in ipairs(MonsterListFrame:GetChildren()) do
        if c:IsA("TextButton") then c:Destroy() end
    end

    local entities = GetAllEntities()
    if #entities > 0 then
        for idx, ent in ipairs(entities) do
            local btn = Instance.new("TextButton")
            btn.Size = UDim2.new(1, -8, 0, 30)
            btn.BackgroundColor3 = Color3.fromRGB(28, 28, 36)
            btn.Font = Enum.Font.GothamMedium
            btn.Text = "  " .. ent.Name:lower() .. " [" .. tostring(idx) .. "]"
            btn.TextColor3 = Color3.fromRGB(220, 220, 230)
            btn.TextSize = 11
            btn.TextXAlignment = Enum.TextXAlignment.Left
            btn.Parent = MonsterListFrame

            local c = Instance.new("UICorner")
            c.CornerRadius = UDim.new(0, 4)
            c.Parent = btn

            btn.MouseButton1Click:Connect(function()
                LoadMonsterInPreview(ent)
                Notify("showcase", "showing: " .. ent.Name:lower())
            end)
        end
    else
        Notify("showcase", "no entities found in workspace")
    end
end

CreateButton("refresh monster showcase list", function()
    PopulateMonsterShowcase()
end)

PopulateMonsterShowcase()

CreateHeader("event survivals")

local AutoDodgerActive = false
local AutoDodgeDist = 25
local AntiInvisActive = false
local AlertSoundActive = false
local AutoDollyActive = false

CreateToggle("auto dodge", false, function(v)
    AutoDodgerActive = v
    if v then
        task.spawn(function()
            Notify("event survivals", "auto dodger on")
            while AutoDodgerActive do
                task.wait(0.1)
                local char = LocalPlayer.Character
                local hrp = char and char:FindFirstChild("HumanoidRootPart")
                local hum = char and char:FindFirstChildOfClass("Humanoid")

                if hrp and hum and hum.MoveDirection.Magnitude == 0 then
                    local entities = GetAllEntities()
                    for _, ent in ipairs(entities) do
                        if not AutoDodgerActive then break end
                        local ePart = ent:IsA("BasePart") and ent or (ent:IsA("Model") and (ent.PrimaryPart or ent:FindFirstChild("HumanoidRootPart") or ent:FindFirstChild("Head") or ent:FindFirstChildWhichIsA("BasePart")))
                        if ePart then
                            local dist = (ePart.Position - hrp.Position).Magnitude
                            if dist < AutoDodgeDist then
                                local dodgeDir = (hrp.Position - ePart.Position).Unit
                                hrp.CFrame = CFrame.new(hrp.Position + (dodgeDir * 6), hrp.Position + dodgeDir * 10)
                                Notify("auto dodge", "dodged monster")
                                task.wait(0.2)
                            end
                        end
                    end
                end
            end
        end)
    end
end)

CreateSlider("auto dodge radius", 10, 50, 25, function(v)
    AutoDodgeDist = v
end)

CreateToggle("auto survive dolly event", false, function(v)
    AutoDollyActive = v
    if v then
        Notify("dolly event", "auto survive dolly event active")
    end
end)

CreateToggle("reveal invisible monsters", false, function(v)
    AntiInvisActive = v
    if v then
        task.spawn(function()
            while AntiInvisActive do
                task.wait(0.5)
                local entities = GetAllEntities()
                for _, ent in ipairs(entities) do
                    for _, child in ipairs(ent:GetDescendants()) do
                        if child:IsA("BasePart") and child.Transparency > 0.5 then
                            child.Transparency = 0.2
                        end
                    end
                end
            end
        end)
    end
end)

CreateToggle("monster sound alarm alert", false, function(v)
    AlertSoundActive = v
    if v then
        task.spawn(function()
            while AlertSoundActive do
                task.wait(1)
                local char = LocalPlayer.Character
                local hrp = char and char:FindFirstChild("HumanoidRootPart")

                if hrp then
                    local entities = GetAllEntities()
                    for _, ent in ipairs(entities) do
                        local ePart = ent:IsA("BasePart") and ent or (ent:IsA("Model") and (ent.PrimaryPart or ent:FindFirstChild("HumanoidRootPart") or ent:FindFirstChild("Head") or ent:FindFirstChildWhichIsA("BasePart")))
                        if ePart then
                            local dist = (ePart.Position - hrp.Position).Magnitude
                            if dist < 45 then
                                local sound = Instance.new("Sound")
                                sound.SoundId = "rbxassetid://9114223177"
                                sound.Volume = 1
                                sound.Parent = Workspace
                                sound:Play()
                                task.wait(1.5)
                                sound:Destroy()
                            end
                        end
                    end
                end
            end
        end)
    end
end)

CreateButton("instant panic teleport to safe spot", function()
    local hrp = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
    if hrp then
        hrp.CFrame = hrp.CFrame + Vector3.new(0, 120, 0)
        Notify("panic teleport", "teleported up in the air")
    end
end)

CreateHeader("auto mechanics & capture zone")

local AutoScrapActive = false
local AutoCaptureActive = false
local ReviveAuraActive = false

local function GetDebrisFolder()
    local debris = Workspace:FindFirstChild("Debris") or Workspace:FindFirstChild("debris")
    if debris then
        local mapInDebris = debris:FindFirstChild("Map") or debris:FindFirstChild("map")
        if mapInDebris then
            return mapInDebris
        end
        return debris
    end

    local mapFolder = Workspace:FindFirstChild("Map") or Workspace:FindFirstChild("map")
    if mapFolder then
        return mapFolder:FindFirstChild("Debris") or mapFolder:FindFirstChild("debris") or mapFolder
    end

    return Workspace
end

local function GetClosestScrap(hrp)
    local targetContainer = GetDebrisFolder()
    if not targetContainer then return nil end

    local closest, minDistance = nil, math.huge
    for _, item in ipairs(targetContainer:GetDescendants()) do
        local part = nil
        if item:IsA("BasePart") then
            part = item
        elseif item:IsA("Model") then
            part = item.PrimaryPart or item:FindFirstChildWhichIsA("BasePart")
        end

        if part and item.Parent and part:IsDescendantOf(Workspace) then
            local dist = (part.Position - hrp.Position).Magnitude
            if dist < minDistance then
                minDistance = dist
                closest = {Item = item, Part = part}
            end
        end
    end
    return closest
end

CreateToggle("auto collect scrap", false, function(v)
    AutoScrapActive = v
    if v then
        task.spawn(function()
            Notify("auto scrap", "started scrap collection loop")
            while AutoScrapActive do
                task.wait(0.05)
                local char = LocalPlayer.Character
                local hrp = char and char:FindFirstChild("HumanoidRootPart")

                if hrp then
                    local target = GetClosestScrap(hrp)

                    if target and target.Item and target.Item.Parent and target.Part then
                        local item = target.Item
                        local part = target.Part

                        hrp.CFrame = part.CFrame * CFrame.new(0, 0.5, 0)

                        local prompt = item:FindFirstChildWhichIsA("ProximityPrompt", true)
                        if prompt and fireproximityprompt then
                            fireproximityprompt(prompt)
                        end

                        if firetouchinterest then
                            firetouchinterest(hrp, part, 0)
                            task.wait(0.02)
                            firetouchinterest(hrp, part, 1)
                        end

                        local clickDetector = item:FindFirstChildWhichIsA("ClickDetector", true)
                        if clickDetector and fireclickdetector then
                            fireclickdetector(clickDetector)
                        end

                        local startTime = tick()
                        repeat
                            task.wait(0.02)
                        until not item or not item.Parent or (tick() - startTime > 0.15) or not AutoScrapActive
                    else
                        task.wait(0.2)
                    end
                end
            end
            Notify("auto scrap", "stopped auto scrap collection")
        end)
    end
end)

CreateToggle("auto capture zone collect", false, function(v)
    AutoCaptureActive = v
    if v then
        task.spawn(function()
            Notify("capture zones", "auto zone capture active...")
            while AutoCaptureActive do
                task.wait(0.1)
                local char = LocalPlayer.Character
                local hrp = char and char:FindFirstChild("HumanoidRootPart")

                if hrp then
                    local zones = {}
                    local mapFolder = Workspace:FindFirstChild("MapFolder") or Workspace:FindFirstChild("mapfolder") or Workspace
                    for _, obj in ipairs(mapFolder:GetDescendants()) do
                        local n = obj.Name:lower()
                        if n:find("controlpoint") or n:find("capture") or n:find("generator") then
                            if obj:IsA("BasePart") or obj:IsA("Model") then
                                table.insert(zones, obj)
                            end
                        end
                    end

                    if #zones > 0 then
                        for _, zone in ipairs(zones) do
                            if not AutoCaptureActive then break end
                            local targetPart = zone:IsA("BasePart") and zone or (zone.PrimaryPart or zone:FindFirstChildWhichIsA("BasePart"))
                            if targetPart then
                                Notify("capture zones", "moving to zone: " .. zone.Name:lower())
                                SmoothMoveTo(targetPart.CFrame * CFrame.new(0, 3, 0), 40)

                                Notify("capture zones", "capturing zone (spinning)...")
                                local spinStart = tick()
                                local currentAngle = 0
                                while (tick() - spinStart < 63) and AutoCaptureActive do
                                    task.wait(0.03)
                                    currentAngle = currentAngle + 0.15
                                    hrp.CFrame = CFrame.new(targetPart.Position + Vector3.new(0, 3, 0)) * CFrame.Angles(0, currentAngle, 0)
                                end
                            end
                        end
                    else
                        task.wait(1.5)
                    end
                end
            end
            Notify("capture zones", "stopped auto capture zones")
        end)
    end
end)

local function IsPlayerDowned(player)
    if not player or not player.Character then return false end
    local char = player.Character
    local hum = char:FindFirstChildOfClass("Humanoid")

    if hum and (hum.Health <= 0 or hum:GetState() == Enum.HumanoidStateType.Dead) then
        return true
    end

    if DownedModule then
        local success, downedResult = pcall(function()
            local moduleTable = require(DownedModule)
            if type(moduleTable) == "function" then
                return moduleTable(player) or moduleTable(char)
            elseif type(moduleTable) == "table" then
                if moduleTable.IsDowned then return moduleTable.IsDowned(player) end
                if moduleTable.Check then return moduleTable.Check(player) end
                if moduleTable[player] or moduleTable[player.Name] then return true end
            end
            return false
        end)
        if success and downedResult == true then
            return true
        end
    end

    local hasDownedAttr = char:GetAttribute("Downed") == true 
                       or char:GetAttribute("IsDowned") == true 
                       or char:GetAttribute("Knocked") == true
                       or char:GetAttribute("KO") == true
    
    local isRagdolled = char:FindFirstChild("Ragdoll") ~= nil or char:FindFirstChild("Downed") ~= nil
    return hasDownedAttr or isRagdolled
end

local function doReviveAura()
    if not LocalPlayer.Character or not LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then return end
    local myPos = LocalPlayer.Character.HumanoidRootPart.Position

    for _, obj in ipairs(Workspace:GetDescendants()) do
        if obj:IsA("ProximityPrompt") then
            if obj.ObjectText == "Revive" or obj.ActionText == "Revive" or string.match(obj.Name:lower(), "revive") then
                local promptParent = obj:FindFirstAncestorOfClass("Model")
                if promptParent and promptParent:FindFirstChild("HumanoidRootPart") then
                    local targetPos = promptParent.HumanoidRootPart.Position
                    local distance = (myPos - targetPos).Magnitude

                    if distance <= maxDistance then
                        if fireproximityprompt then
                            fireproximityprompt(obj)
                        end
                    end
                end
            end
        end
    end
end

CreateToggle("revive aura", false, function(v)
    ReviveAuraActive = v
    if v then
        task.spawn(function()
            Notify("revive aura", "revive aura activated")
            while ReviveAuraActive do
                task.wait(0.1)
                pcall(doReviveAura)
            end
            Notify("revive aura", "revive aura disabled")
        end)
    end
end)

local function GetTargetTimerModel()
    local cilentFolder = Workspace:FindFirstChild("Cilent") or Workspace:FindFirstChild("cilent") or Workspace:FindFirstChild("Client")
    if cilentFolder then
        local timerModel = cilentFolder:FindFirstChild("Timer") or cilentFolder:FindFirstChild("timer") or cilentFolder:FindFirstChild("Model")
        if timerModel then
            return timerModel
        end
        return cilentFolder
    end
    return Workspace:FindFirstChild("Timer") or Workspace:FindFirstChild("timer")
end

CreateToggle("show or hide timer", true, function(state)
    local target = GetTargetTimerModel()
    if target then
        if target:IsA("Model") or target:IsA("Folder") then
            for _, obj in ipairs(target:GetDescendants()) do
                if obj:IsA("BasePart") then
                    obj.Transparency = state and 0 or 1
                elseif obj:IsA("BillboardGui") or obj:IsA("SurfaceGui") then
                    obj.Enabled = state
                end
            end
        elseif target:IsA("BasePart") then
            target.Transparency = state and 0 or 1
        end
        Notify("timer toggle", state and "timer visible" or "timer hidden")
    else
        Notify("timer toggle", "timer folder not found in workspace.cilent")
    end
end)

CreateButton("teleport to exit", function()
    local hrp = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
    if hrp then
        for _, exit in ipairs(Workspace:GetDescendants()) do
            local n = exit.Name:lower()
            if n:find("exitpoint") or n:find("escapedoor") or n:find("exit") then
                local part = exit:IsA("BasePart") and exit or exit:FindFirstChildWhichIsA("BasePart")
                if part then
                    hrp.CFrame = part.CFrame + Vector3.new(0, 3, 0)
                    Notify("exit teleport", "teleported to exit")
                    return
                end
            end
        end
        Notify("exit teleport", "exit door not found")
    end
end)

CreateHeader("scrap counter display")

local TrackerFrame = Instance.new("Frame")
TrackerFrame.Size = UDim2.new(0, 220, 0, 75)
TrackerFrame.Position = UDim2.new(0, 20, 0.4, 0)
TrackerFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 26)
TrackerFrame.Visible = false
TrackerFrame.Parent = MainGui

local TrackerCorner = Instance.new("UICorner")
TrackerCorner.CornerRadius = UDim.new(0, 6)
TrackerCorner.Parent = TrackerFrame

local TrackerStroke = Instance.new("UIStroke")
TrackerStroke.Color = Color3.fromRGB(255, 215, 0)
TrackerStroke.Thickness = 1.5
TrackerStroke.Parent = TrackerFrame

local TrackerText = Instance.new("TextLabel")
TrackerText.Size = UDim2.new(1, 0, 1, 0)
TrackerText.BackgroundTransparency = 1
TrackerText.Font = Enum.Font.GothamBold
TrackerText.Text = "scrap counter\nremaining scrap: 0\ncollected scrap: 0"
TrackerText.TextColor3 = Color3.fromRGB(255, 215, 0)
TrackerText.TextSize = 11
TrackerText.Parent = TrackerFrame

CreateToggle("show scrap counter box", false, function(v) TrackerFrame.Visible = v end)

task.spawn(function()
    while task.wait(0.5) do
        if TrackerFrame.Visible then
            local count = 0
            local debris = GetDebrisFolder()
            if debris then
                for _, item in ipairs(debris:GetChildren()) do
                    if item:IsA("BasePart") or item:IsA("Model") then
                        count = count + 1
                    end
                end
            end
            local myScrap = LocalPlayer:GetAttribute("Scrap") or LocalPlayer:GetAttribute("ScrapVal") or 0
            TrackerText.Text = "scrap counter\nremaining scrap: " .. tostring(count) .. "\ncollected scrap: " .. tostring(myScrap)
        end
    end
end)

CreateHeader("visuals & esp")

local ESPState = { Player = false, Monster = false, Scrap = false, Capture = false }
local ESPCache = { Player = {}, Monster = {}, Scrap = {}, Capture = {} }
local ArrowToMonstersActive = false
local ArrowCache = {}

local function ClearCategory(cat)
    for inst, elements in pairs(ESPCache[cat]) do
        for _, el in ipairs(elements) do
            if el and el.Parent then el:Destroy() end
        end
    end
    ESPCache[cat] = {}
end

local function ClearArrows()
    for inst, arrowGui in pairs(ArrowCache) do
        if arrowGui and arrowGui.Parent then
            arrowGui:Destroy()
        end
    end
    ArrowCache = {}
end

local function ApplyESP(inst, color, cat, text)
    if not inst or not inst.Parent or ESPCache[cat][inst] then return end
    local elements = {}
    local targetPart = inst:IsA("BasePart") and inst or (inst:IsA("Model") and (inst.PrimaryPart or inst:FindFirstChild("HumanoidRootPart") or inst:FindFirstChild("Head") or inst:FindFirstChildWhichIsA("BasePart")))
    if not targetPart then return end

    local hl = Instance.new("Highlight")
    hl.Name = "DH_HL"
    hl.FillColor = color
    hl.OutlineColor = Color3.fromRGB(255, 255, 255)
    hl.FillTransparency = 0.5
    hl.OutlineTransparency = 0.1
    hl.Adornee = inst
    hl.Parent = inst
    table.insert(elements, hl)

    if text then
        local bb = Instance.new("BillboardGui")
        bb.Name = "DH_BB"
        bb.AlwaysOnTop = true
        bb.Size = UDim2.new(0, 140, 0, 24)
        bb.StudsOffset = Vector3.new(0, 3, 0)
        bb.Adornee = targetPart

        local lbl = Instance.new("TextLabel")
        lbl.Size = UDim2.new(1, 0, 1, 0)
        lbl.BackgroundTransparency = 1
        lbl.Font = Enum.Font.GothamBold
        lbl.Text = text:lower()
        lbl.TextColor3 = color
        lbl.TextSize = 11
        lbl.TextStrokeTransparency = 0.2
        lbl.Parent = bb
        bb.Parent = inst
        table.insert(elements, bb)
    end
    ESPCache[cat][inst] = elements
end

CreateToggle("arrow to monsters", false, function(v)
    ArrowToMonstersActive = v
    if not v then
        ClearArrows()
        Notify("visuals", "arrow to monsters disabled")
    else
        Notify("visuals", "arrow to monsters enabled")
    end
end)

CreateToggle("player esp", false, function(v) ESPState.Player = v if not v then ClearCategory("Player") end end)
CreateToggle("monster esp", false, function(v) ESPState.Monster = v if not v then ClearCategory("Monster") end end)
CreateToggle("scrap esp", false, function(v) ESPState.Scrap = v if not v then ClearCategory("Scrap") end end)
CreateToggle("control point / capture esp", false, function(v) ESPState.Capture = v if not v then ClearCategory("Capture") end end)

CreateToggle("fullbright & remove fog", false, function(v)
    if v then
        Lighting.Ambient = Color3.fromRGB(255, 255, 255)
        Lighting.OutdoorAmbient = Color3.fromRGB(255, 255, 255)
        Lighting.FogEnd = 1e6
    else
        Lighting.Ambient = Color3.fromRGB(120, 120, 120)
        Lighting.OutdoorAmbient = Color3.fromRGB(120, 120, 120)
        Lighting.FogEnd = 100000
    end
end)

CreateSlider("camera fov", 70, 120, 70, function(v)
    Workspace.CurrentCamera.FieldOfView = v
end)

-- Real-time RenderStepped update loop for direction-accurate tracking arrows
RunService.RenderStepped:Connect(function()
    if not ArrowToMonstersActive then 
        ClearArrows()
        return 
    end

    local char = LocalPlayer.Character
    local head = char and (char:FindFirstChild("Head") or char:FindFirstChild("HumanoidRootPart"))
    local cam = Workspace.CurrentCamera

    if not head or not cam then
        ClearArrows()
        return
    end

    local entities = GetAllEntities()
    local currentEntities = {}

    for idx, ent in ipairs(entities) do
        currentEntities[ent] = true
        local targetPart = ent:IsA("BasePart") and ent or (ent:IsA("Model") and (ent.PrimaryPart or ent:FindFirstChild("HumanoidRootPart") or ent:FindFirstChild("Head") or ent:FindFirstChildWhichIsA("BasePart")))

        if targetPart then
            local arrowGui = ArrowCache[ent]
            if not arrowGui or not arrowGui.Parent then
                arrowGui = Instance.new("BillboardGui")
                arrowGui.Name = "MonsterArrowGui"
                arrowGui.AlwaysOnTop = true
                arrowGui.Size = UDim2.new(0, 40, 0, 40)
                arrowGui.Adornee = head
                arrowGui.Parent = MainGui

                local arrowImg = Instance.new("ImageLabel")
                arrowImg.Name = "Arrow"
                arrowImg.Size = UDim2.new(0, 24, 0, 24)
                arrowImg.Position = UDim2.new(0.5, -12, 0.5, -12)
                arrowImg.BackgroundTransparency = 1
                arrowImg.Image = "rbxassetid://6034818372"
                arrowImg.ImageColor3 = Color3.fromRGB(255, 50, 50)
                arrowImg.Parent = arrowGui

                local distLbl = Instance.new("TextLabel")
                distLbl.Name = "Dist"
                distLbl.Size = UDim2.new(1, 0, 0, 12)
                distLbl.Position = UDim2.new(0, 0, 0, -10)
                distLbl.BackgroundTransparency = 1
                distLbl.Font = Enum.Font.GothamBold
                distLbl.TextSize = 9
                distLbl.TextColor3 = Color3.fromRGB(255, 255, 255)
                distLbl.TextStrokeTransparency = 0.3
                distLbl.Parent = arrowGui

                ArrowCache[ent] = arrowGui
            end

            -- Alternates arrows on the sides of player head to avoid overlapping
            local isEven = (idx % 2 == 0)
            local sideMultiplier = isEven and 1 or -1
            local stackOffset = math.floor((idx - 1) / 2) * 1.2
            local xOffset = sideMultiplier * (2.2 + stackOffset)
            local yOffset = 1.5

            arrowGui.StudsOffset = Vector3.new(xOffset, yOffset, 0)

            -- ACCURATE POINT-AT-TARGET ROTATION MATH
            local targetPos = targetPart.Position
            local dist = math.floor((targetPos - head.Position).Magnitude)
            
            -- Compute angle using camera-relative coordinate space
            local localDir = cam.CFrame:VectorToObjectSpace(targetPos - cam.CFrame.Position)
            local angle = math.atan2(-localDir.X, -localDir.Z)

            local arrowImg = arrowGui:FindFirstChild("Arrow")
            local distLbl = arrowGui:FindFirstChild("Dist")

            if arrowImg then
                arrowImg.Rotation = math.deg(angle)
                if dist < 30 then
                    arrowImg.ImageColor3 = Color3.fromRGB(255, 40, 40)
                elseif dist < 70 then
                    arrowImg.ImageColor3 = Color3.fromRGB(255, 180, 30)
                else
                    arrowImg.ImageColor3 = Color3.fromRGB(80, 255, 120)
                end
            end

            if distLbl then
                distLbl.Text = tostring(dist) .. "m"
            end
        end
    end

    -- Clean up despawned entity arrows
    for ent, arrowGui in pairs(ArrowCache) do
        if not currentEntities[ent] or not ent.Parent then
            if arrowGui and arrowGui.Parent then arrowGui:Destroy() end
            ArrowCache[ent] = nil
        end
    end
end)

task.spawn(function()
    while task.wait(0.4) do
        if ESPState.Monster then
            local entities = GetAllEntities()
            for _, ent in ipairs(entities) do
                ApplyESP(ent, Color3.fromRGB(255, 45, 45), "Monster", "monster: " .. ent.Name)
            end
        end

        if ESPState.Scrap then
            local debris = GetDebrisFolder()
            if debris then
                for _, item in ipairs(debris:GetChildren()) do
                    if item:IsA("BasePart") or item:IsA("Model") then
                        ApplyESP(item, Color3.fromRGB(255, 215, 0), "Scrap", "scrap")
                    end
                end
            end
        end

        if ESPState.Capture then
            for _, obj in ipairs(Workspace:GetDescendants()) do
                local n = obj.Name:lower()
                if n:find("controlpoint") or n:find("capture") or n:find("generator") or n:find("zone") then
                    if obj:IsA("BasePart") or obj:IsA("Model") then
                        ApplyESP(obj, Color3.fromRGB(80, 255, 120), "Capture", "control point")
                    end
                end
            end
        end

        if ESPState.Player then
            for _, p in ipairs(Players:GetPlayers()) do
                if p ~= LocalPlayer and p.Character then
                    ApplyESP(p.Character, Color3.fromRGB(0, 200, 255), "Player", p.Name)
                end
            end
        end
    end
end)

CreateHeader("player modifications")

local CustomSpeedEnabled = false
local CustomSpeedMult = 20
local CustomJumpEnabled = false
local CustomJumpPower = 50
local InfStamina = false
local NoclipActive = false
local ClickTPEnabled = false

CreateToggle("enable walkspeed", false, function(v) CustomSpeedEnabled = v end)
CreateSlider("walkspeed multiplier", 16, 100, 20, function(v) CustomSpeedMult = v end)

CreateToggle("enable jump power", false, function(v) CustomJumpEnabled = v end)
CreateSlider("jump power force", 50, 180, 50, function(v) CustomJumpPower = v end)

CreateToggle("infinite stamina", false, function(v) 
    InfStamina = v 
    if SharedCharacter then
        if InfStamina then
            SharedCharacter.DepleteStamina = function(self, ...)
                if self.State then
                    self.State.Stamina = self.State.MaxStamina or 100
                    self.State.BadStamina = false
                    self.State.StaminaCooldown = 0
                end
            end
            Notify("stamina bypass", "module stamina depletion overridden")
        else
            if OriginalDepleteStamina then
                SharedCharacter.DepleteStamina = OriginalDepleteStamina
            end
            Notify("stamina bypass", "stamina depletion restored")
        end
    else
        Notify("stamina bypass", "SharedCharacter module not found, using attribute fallback")
    end
end)

CreateToggle("noclip mode", false, function(v) NoclipActive = v end)
CreateToggle("click teleport (hold ctrl + left click)", false, function(v) ClickTPEnabled = v end)

UserInputService.InputBegan:Connect(function(input, gameProcessed)
    if gameProcessed then return end
    if ClickTPEnabled and input.UserInputType == Enum.UserInputType.MouseButton1 and UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) then
        local mouse = LocalPlayer:GetMouse()
        if mouse and mouse.Hit and LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
            LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(mouse.Hit.Position + Vector3.new(0, 3, 0))
            Notify("click tp", "teleported to mouse cursor")
        end
    end
end)

RunService.RenderStepped:Connect(function()
    local char = LocalPlayer.Character
    if char then
        local hrp = char:FindFirstChild("HumanoidRootPart")
        local hum = char:FindFirstChildOfClass("Humanoid")

        if hrp and hum then
            if CustomSpeedEnabled and hum.MoveDirection.Magnitude > 0 then
                hrp.CFrame = hrp.CFrame + (hum.MoveDirection * (CustomSpeedMult / 40))
            end

            if CustomJumpEnabled and UserInputService:IsKeyDown(Enum.KeyCode.Space) and hum:GetState() ~= Enum.HumanoidStateType.Freefall then
                hrp.Velocity = Vector3.new(hrp.Velocity.X, CustomJumpPower, hrp.Velocity.Z)
            end
        end

        if InfStamina then
            char:SetAttribute("Stamina", 100)
            char:SetAttribute("Energy", 100)
        end

        if NoclipActive then
            for _, part in ipairs(char:GetDescendants()) do
                if part:IsA("BasePart") then part.CanCollide = false end
            end
        end
    end
end)

CreateHeader("map checkout & spectator povs")

local CheckingMap = false

CreateToggle("map orbit camera view", false, function(v)
    CheckingMap = v
    if v then
        Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
        task.spawn(function()
            local angle = 0
            while CheckingMap do
                task.wait(0.02)
                angle = angle + 0.005
                local center = Vector3.new(0, 30, 0)
                local x = center.X + math.cos(angle) * 120
                local z = center.Z + math.sin(angle) * 120
                Workspace.CurrentCamera.CFrame = CFrame.new(Vector3.new(x, center.Y + 60, z), center)
            end
            Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
        end)
    else
        Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
    end
end)

local ViewingPOV = false
local POVTarget = nil
local POVMode = "3rd"

local function StopPOV()
    ViewingPOV = false
    POVTarget = nil
    Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
    if LocalPlayer.Character and LocalPlayer.Character:FindFirstChildOfClass("Humanoid") then
        Workspace.CurrentCamera.CameraSubject = LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
    end
end

local function GetTargetPart(target)
    if not target then return nil end
    if target:IsA("BasePart") then return target end
    return target:FindFirstChild("Head") or target:FindFirstChild("HumanoidRootPart") or target.PrimaryPart or target:FindFirstChildWhichIsA("BasePart")
end

local function SetCameraTarget(target)
    if not target or not target.Parent then
        StopPOV()
        return
    end

    if POVMode == "3rd" then
        local hum = target:FindFirstChildOfClass("Humanoid")
        if hum then
            Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
            Workspace.CurrentCamera.CameraSubject = hum
        else
            local primary = GetTargetPart(target)
            if primary then
                Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
                Workspace.CurrentCamera.CFrame = primary.CFrame * CFrame.new(0, 2, 6)
            else
                StopPOV()
            end
        end
    elseif POVMode == "1st" then
        Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
        local head = GetTargetPart(target)
        if head then
            Workspace.CurrentCamera.CFrame = head.CFrame * CFrame.new(0, 0.2, -0.2)
        end
    end
end

local ModeBtn = CreateButton("spectate mode: third person", function() end)

local function UpdateModeButton()
    ModeBtn.Text = "spectate mode: " .. (POVMode == "3rd" and "third person (orbit)" or "first person (head)")
    if ViewingPOV and POVTarget then
        SetCameraTarget(POVTarget)
    end
end

ModeBtn.MouseButton1Click:Connect(function()
    POVMode = (POVMode == "3rd") and "1st" or "3rd"
    UpdateModeButton()
    Notify("pov mode", "switched view mode to: " .. (POVMode == "3rd" and "third person" or "first person"))
end)

CreateButton("reset camera back to character", function()
    StopPOV()
    Notify("pov system", "camera reset back to local character")
end)

local MonsterScroll = Instance.new("ScrollingFrame")
MonsterScroll.Size = UDim2.new(1, 0, 0, 90)
MonsterScroll.BackgroundColor3 = Color3.fromRGB(22, 22, 28)
MonsterScroll.BorderSizePixel = 0
MonsterScroll.ScrollBarThickness = 3
MonsterScroll.Parent = MainScroll

local MonsterLayout = Instance.new("UIListLayout")
MonsterLayout.SortOrder = Enum.SortOrder.LayoutOrder
MonsterLayout.Padding = UDim.new(0, 4)
MonsterLayout.Parent = MonsterScroll

MonsterLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
    MonsterScroll.CanvasSize = UDim2.new(0, 0, 0, MonsterLayout.AbsoluteContentSize.Y + 5)
end)

local PlayerScroll = Instance.new("ScrollingFrame")
PlayerScroll.Size = UDim2.new(1, 0, 0, 90)
PlayerScroll.BackgroundColor3 = Color3.fromRGB(22, 22, 28)
PlayerScroll.BorderSizePixel = 0
PlayerScroll.ScrollBarThickness = 3
PlayerScroll.Parent = MainScroll

local PlayerLayout = Instance.new("UIListLayout")
PlayerLayout.SortOrder = Enum.SortOrder.LayoutOrder
PlayerLayout.Padding = UDim.new(0, 4)
PlayerLayout.Parent = PlayerScroll

PlayerLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
    PlayerScroll.CanvasSize = UDim2.new(0, 0, 0, PlayerLayout.AbsoluteContentSize.Y + 5)
end)

local function RefreshPOVS()
    for _, child in ipairs(MonsterScroll:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end
    for _, child in ipairs(PlayerScroll:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end

    local entities = GetAllEntities()
    for idx, ent in ipairs(entities) do
        local btn = Instance.new("TextButton")
        btn.Size = UDim2.new(1, -8, 0, 26)
        btn.BackgroundColor3 = Color3.fromRGB(45, 25, 30)
        btn.Font = Enum.Font.Gotham
        btn.Text = "watch monster: " .. ent.Name:lower() .. " [" .. tostring(idx) .. "]"
        btn.TextColor3 = Color3.fromRGB(255, 120, 120)
        btn.TextSize = 11
        btn.Parent = MonsterScroll

        local c = Instance.new("UICorner")
        c.CornerRadius = UDim.new(0, 4)
        c.Parent = btn

        btn.MouseButton1Click:Connect(function()
            POVTarget = ent
            ViewingPOV = true
            SetCameraTarget(ent)
            Notify("pov system", "spectating monster: " .. ent.Name:lower())
        end)
    end

    for _, p in ipairs(Players:GetPlayers()) do
        if p ~= LocalPlayer and p.Character then
            local btn = Instance.new("TextButton")
            btn.Size = UDim2.new(1, -8, 0, 26)
            btn.BackgroundColor3 = Color3.fromRGB(25, 35, 45)
            btn.Font = Enum.Font.Gotham
            btn.Text = "watch player: " .. p.Name:lower()
            btn.TextColor3 = Color3.fromRGB(120, 200, 255)
            btn.TextSize = 11
            btn.Parent = PlayerScroll

            local c = Instance.new("UICorner")
            c.CornerRadius = UDim.new(0, 4)
            c.Parent = btn

            btn.MouseButton1Click:Connect(function()
                POVTarget = p.Character
                ViewingPOV = true
                SetCameraTarget(p.Character)
                Notify("pov system", "spectating player: " .. p.Name:lower())
            end)
        end
    end
end

CreateButton("refresh spectator pov targets", function() RefreshPOVS() end)

RunService.RenderStepped:Connect(function()
    if ViewingPOV then
        if POVTarget and POVTarget.Parent then
            if POVMode == "1st" then
                local head = GetTargetPart(POVTarget)
                if head then
                    Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
                    Workspace.CurrentCamera.CFrame = head.CFrame * CFrame.new(0, 0.2, -0.2)
                else
                    StopPOV()
                end
            elseif POVMode == "3rd" then
                local hum = POVTarget:FindFirstChildOfClass("Humanoid")
                if not hum then
                    local primary = GetTargetPart(POVTarget)
                    if primary then
                        Workspace.CurrentCamera.CFrame = primary.CFrame * CFrame.new(0, 2, 6)
                    else
                        StopPOV()
                    end
                end
            end
        else
            StopPOV()
        end
    end
end)

local function TeleportToNearestAlivePlayer()
    if IsPlayerDowned(LocalPlayer) then return end

    local char = LocalPlayer.Character
    local hrp = char and char:FindFirstChild("HumanoidRootPart")
    if not hrp then return end

    local nearest, minDist = nil, math.huge
    for _, p in ipairs(Players:GetPlayers()) do
        if p ~= LocalPlayer and p.Character then
            local pHum = p.Character:FindFirstChildOfClass("Humanoid")
            local pHrp = p.Character:FindFirstChild("HumanoidRootPart")
            if pHum and pHum.Health > 0 and pHrp and not IsPlayerDowned(p) then
                local dist = (pHrp.Position - hrp.Position).Magnitude
                if dist < minDist then
                    minDist = dist
                    nearest = pHrp
                end
            end
        end
    end

    if nearest then
        hrp.CFrame = nearest.CFrame * CFrame.new(0, 0, 3)
        Notify("downed tp", "teleported to nearest alive player: " .. nearest.Parent.Name:lower())
    end
end

local function HideInSmartSpot()
    local char = LocalPlayer.Character
    local hrp = char and char:FindFirstChild("HumanoidRootPart")
    if not hrp then return end

    local mapFolder = Workspace:FindFirstChild("MapFolder")
    local mainMap = mapFolder and mapFolder:FindFirstChild("Main")

    if mainMap then
        local validSpots = {}
        for _, part in ipairs(mainMap:GetDescendants()) do
            if part:IsA("BasePart") and part.Size.Y > 4 and part.CanCollide then
                table.insert(validSpots, part)
            end
        end

        if #validSpots > 0 then
            local chosen = validSpots[math.random(1, #validSpots)]
            hrp.CFrame = chosen.CFrame * CFrame.new(0, chosen.Size.Y/2 + 3, 0)
            Notify("smart hide", "placed character in map hiding spot")
            return
        end
    end

    hrp.CFrame = hrp.CFrame * CFrame.new(0, 20, 0)
    Notify("smart hide", "map main folder not found, teleported up")
end

local function FreeCharacterFromDolly()
    local char = LocalPlayer.Character
    local hrp = char and char:FindFirstChild("HumanoidRootPart")
    local hum = char and char:FindFirstChildOfClass("Humanoid")

    if hrp then
        hrp.Anchored = false
        for _, p in ipairs(char:GetDescendants()) do
            if p:IsA("BasePart") then p.Anchored = false end
        end
    end
    if hum then
        hum.PlatformStand = false
        hum:ChangeState(Enum.HumanoidStateType.GettingUp)
    end
    Notify("dolly event", "freed character from dolly lock")
end

local function SetupSoundListener(sound)
    if not sound or not sound:IsA("Sound") then return end

    sound.Played:Connect(function()
        local sId = sound.SoundId
        local sName = sound.Name:lower()

        if AutoDollyActive and (sName == "look" or sId:find("86427561503613")) then
            FreeCharacterFromDolly()
        end

        if sName == "downedmus" or sId:find("124126285504791") then
            TeleportToNearestAlivePlayer()
        end

        if sName == "spawnextrainindicator" or sId:find("131800688834543") then
            HideInSmartSpot()
        end
    end)
end

for _, desc in ipairs(ReplicatedFirst:GetDescendants()) do
    if desc:IsA("Sound") then
        SetupSoundListener(desc)
    end
end

ReplicatedFirst.DescendantAdded:Connect(function(desc)
    if desc:IsA("Sound") then
        SetupSoundListener(desc)
    end
end)

RefreshPOVS()

task.spawn(function()
    task.wait(1)
    local vu = game:GetService("VirtualUser")
    LocalPlayer.Idled:Connect(function()
        vu:Button2Down(Vector2.new(0,0), Workspace.CurrentCamera.CFrame)
        task.wait(1)
        vu:Button2Up(Vector2.new(0,0), Workspace.CurrentCamera.CFrame)
    end)
end)

Notify("script hub", "pre-alpha 1.0 loaded")

Features & Information

_auto dodge _auto scrap collect (broken fixed 23 times srry im working on it..) _auto ControlPoint collect _show or hide timer _show scrap counter _player esp _monster esp _scrap esp _controlpoint esp _fullbright & remove fog _camera fov _tp to exit _enable ws _enable jp _inf stamina _noclip _map orbit view _spectate pov _monster showcase _click teleport _camera fov (doesn't work) BC IT IS DH FOV'S _survive dolly (doesn't work) _arrow to monsters ---------------------------------------------- That's all the features, this is 1.0 so it will only be shown for a little while, enjoy though, scrap auto collect is broke btw, still use it if you want just if you can't find scrap, we also may delete the script due to several bugs, and we DO NOT want fans hating on this, so we will try our best to update. DON'T TRY THE GITHUB VERSION, REASON WHY, IS BECAUSE THAT ONE IS BROKEN AND DOESN'T WORK TRY THIS ONE FROM RSCRIPTS and Scriptblox. That's the original, the other person copied me.
#Beta#Vinq#Darkest Hours#Hub#WIP

Community Comments (0)

No comments yet for this script.

More Scripts for [V0.2 PRE-ALPHA] Darkest Hours