99 Nights open src
Key Required

99 Nights open src

99 Nights in the Forest 🔦milesthegreatmilesthegreat 290 views 708 executesUpdated Aug 2, 2026
Unrated
00
Lua Script•1556 lines (47190 chars)
local unpack = unpack or table.unpack
local Rayfield

for _, url in ipairs({
    "https://sirius.menu/rayfield",
    "https://raw.githubusercontent.com/SiriusSoftwareLtd/Rayfield/main/source.lua",
    "https://cdn.sirius.menu/rayfield"
}) do
    local success, result = pcall(function()
        return loadstring(game:HttpGet(url, true))()
    end)

    if success and result then
        Rayfield = result
        break
    end

    task.wait(1)
end

if not Rayfield then
    game:GetService("StarterGui"):SetCore("SendNotification", {
        Title = "Error",
        Text = "Rayfield failed to load.",
        Duration = 6
    })
    return
end

local Window = Rayfield:CreateWindow({
    Name = "Gooner Hub v2",
    LoadingTitle = "Loading...",
    LoadingSubtitle = "by DG181",
    ConfigurationSaving = {
        Enabled = false
    }
})

local MainTab = Window:CreateTab("Main", 4483362458)
local AutoTab = Window:CreateTab("Auto", 4483362458)
local ItemsTab = Window:CreateTab("Items", 4483362458)
local ESPTab = Window:CreateTab("ESP", 4483362458)
local TeleportTab = Window:CreateTab("Teleport", 4483362458)
local PlayerTab = Window:CreateTab("Player", 4483362458)
local MiscTab = Window:CreateTab("Misc", 4483362458)

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local VirtualInputManager = game:GetService("VirtualInputManager")
local LocalPlayer = Players.LocalPlayer
local Characters = workspace:WaitForChild("Characters")
local Items = workspace:WaitForChild("Items")
local Map = workspace:FindFirstChild("Map")
local RemoteEvents = ReplicatedStorage:WaitForChild("RemoteEvents")

RemoteEvents:WaitForChild("RequestStartDraggingItem")
RemoteEvents:WaitForChild("StopDraggingItem")
RemoteEvents:WaitForChild("DamagePlayer")
RemoteEvents:WaitForChild("RequestConsumeItem")

local function getCharacter()
    return LocalPlayer.Character
end

local function getRootPart()
    local char = LocalPlayer.Character
    if char then
        char = char:FindFirstChild("HumanoidRootPart")
    end
    return char
end

local function getHumanoid()
    local char = LocalPlayer.Character
    if char then
        char = char:FindFirstChildOfClass("Humanoid")
    end
    return char
end

local function getPrimaryPart(obj)
    if not obj then return nil end
    if obj:IsA("Model") then
        local primary = obj.PrimaryPart
        if not primary then
            primary = obj:FindFirstChildWhichIsA("BasePart")
        end
        return primary
    end
    local part = obj:IsA("BasePart") and obj
    if not part then
        part = obj:FindFirstChildWhichIsA("BasePart")
    end
    return part
end

local function teleportTo(part)
    local root = getRootPart()
    if root and part then
        root.CFrame = part.CFrame + Vector3.new(0, 5, 0)
    end
end

local TempStorage = ReplicatedStorage:FindFirstChild("TempStorage")

local function getDragRemotes()
    local remotes = game:GetService("ReplicatedStorage"):FindFirstChild("RemoteEvents")
    local startRemote = remotes
    if remotes then
        startRemote = remotes:FindFirstChild("RequestStartDraggingItem")
    end
    if remotes then
        remotes = remotes:FindFirstChild("StopDraggingItem")
    end
    return startRemote, remotes
end

local function bringItem(item, position)
    if not item then return end
    local isDescendant = item:IsDescendantOf(workspace)
    if not isDescendant then
        isDescendant = TempStorage and item:IsDescendantOf(TempStorage)
    end
    if not isDescendant then return end

    local primary = item.PrimaryPart
    if not primary then
        primary = item:FindFirstChildWhichIsA("BasePart")
        if not primary then
            primary = item:FindFirstChild("Handle")
        end
    end

    local foundPart = primary
    if not foundPart then return end

    if not item.PrimaryPart then
        pcall(function()
            item.PrimaryPart = foundPart
        end)
    end

    pcall(function()
        local startDrag, stopDrag = getDragRemotes()
        if not startDrag or not stopDrag then return end

        startDrag:FireServer(item)
        task.wait(0.05)

        if item.PrimaryPart then
            item:SetPrimaryPartCFrame(CFrame.new(position))
        else
            foundPart.CFrame = CFrame.new(position)
        end

        task.wait(0.05)
        stopDrag:FireServer(item)
    end)
end

local lightingData = {}
local partData = {}
local effectData = {}
local brightnessEnabled = false
local brightnessConnection
local Lighting = game:GetService("Lighting")

local function applyBrightness()
    Lighting.GlobalShadows = false
    Lighting.Brightness = 2
    Lighting.Ambient = Color3.new(1, 1, 1)
    Lighting.OutdoorAmbient = Color3.new(1, 1, 1)
    Lighting.ClockTime = 14
    Lighting.FogEnd = 1000000000
    Lighting.FogStart = 1000000000
end

local function enableBrightness()
    local terrain = workspace:FindFirstChildOfClass("Terrain")

    if not lightingData.saved then
        lightingData.saved = true
        lightingData.GlobalShadows = Lighting.GlobalShadows
        lightingData.FogEnd = Lighting.FogEnd
        lightingData.FogStart = Lighting.FogStart
        lightingData.Brightness = Lighting.Brightness
        lightingData.Ambient = Lighting.Ambient
        lightingData.OutdoorAmbient = Lighting.OutdoorAmbient
        lightingData.ClockTime = Lighting.ClockTime
    end

    applyBrightness()

    for _, child in ipairs(Lighting:GetChildren()) do
        local isEffect = child:IsA("PostEffect")
        if not isEffect then
            isEffect = child:IsA("Sky")
            if not isEffect then
                isEffect = child:IsA("Clouds")
            end
        end

        if isEffect then
            if effectData[child] == nil then
                effectData[child] = child.Enabled
            end
            pcall(function()
                child.Enabled = false
            end)
        end
    end

    if terrain then
        terrain.WaterWaveSize = 0
        terrain.WaterWaveSpeed = 0
        terrain.WaterReflectance = 0
        terrain.WaterTransparency = 1
        terrain.Decoration = false
    end

    pcall(function()
        settings().Rendering.QualityLevel = Enum.QualityLevel.Level01
    end)

    if Map then
        task.spawn(function()
            local count = 0
            for _, descendant in ipairs(Map:GetDescendants()) do
                count += 1
                if descendant:IsA("BasePart") then
                    if not partData[descendant] then
                        partData[descendant] = {
                            Reflectance = descendant.Reflectance,
                            CastShadow = descendant.CastShadow
                        }
                    end
                    descendant.Reflectance = 0
                    descendant.CastShadow = false
                else
                    local isParticle = descendant:IsA("ParticleEmitter")
                    if not isParticle then
                        isParticle = descendant:IsA("Trail")
                        if not isParticle then
                            isParticle = descendant:IsA("Smoke")
                            if not isParticle then
                                isParticle = descendant:IsA("Fire")
                                if not isParticle then
                                    isParticle = descendant:IsA("Sparkles")
                                    if not isParticle then
                                        isParticle = descendant:IsA("SurfaceLight")
                                        if not isParticle then
                                            isParticle = descendant:IsA("PointLight")
                                            if not isParticle then
                                                isParticle = descendant:IsA("SpotLight")
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end

                    if isParticle then
                        pcall(function()
                            descendant.Enabled = false
                        end)
                    end
                end

                if count % 150 == 0 then
                    task.wait()
                end
            end
            Rayfield:Notify({
                Title = "FPS Boost",
                Content = "Active — Fullbright ON",
                Duration = 3
            })
        end)
    end

    if brightnessConnection then
        brightnessConnection:Disconnect()
    end

    brightnessConnection = RunService.Heartbeat:Connect(function()
        if not brightnessEnabled then
            brightnessConnection:Disconnect()
            return
        end

        local needsUpdate = Lighting.ClockTime ~= 14
        if not needsUpdate then
            needsUpdate = Lighting.Brightness ~= 2
        end

        if needsUpdate then
            applyBrightness()
        end
    end)
end

local function disableBrightness()
    if brightnessConnection then
        brightnessConnection:Disconnect()
    end

    if lightingData.saved then
        Lighting.GlobalShadows = lightingData.GlobalShadows
        Lighting.FogEnd = lightingData.FogEnd
        Lighting.FogStart = lightingData.FogStart
        Lighting.Brightness = lightingData.Brightness
        Lighting.Ambient = lightingData.Ambient
        Lighting.OutdoorAmbient = lightingData.OutdoorAmbient
        Lighting.ClockTime = lightingData.ClockTime
    end

    for effect, state in pairs(effectData) do
        if effect and effect.Parent then
            pcall(function()
                effect.Enabled = state
            end)
        end
    end

    for part, data in pairs(partData) do
        if part and part.Parent then
            part.Reflectance = data.Reflectance
            part.CastShadow = data.CastShadow
        end
    end

    Rayfield:Notify({
        Title = "FPS Boost",
        Content = "Disabled — Graphics restored",
        Duration = 2
    })
end

MiscTab:CreateToggle({
    Name = "Brightness",
    CurrentValue = false,
    Callback = function(state)
        brightnessEnabled = state
        if state then
            enableBrightness()
        else
            disableBrightness()
        end
    end
})

local function onCharacterAdded(char)
    local humanoid = char:WaitForChild("Humanoid")
    local root = char:WaitForChild("HumanoidRootPart")

    task.wait(0.5)

    if _G.speedEnabled and _G.walkSpeed then
        humanoid.WalkSpeed = _G.walkSpeed
    end

    if _G.flyEnabled then
        task.wait(0.2)

        local bodyVelocity = Instance.new("BodyVelocity", root)
        local bodyGyro = Instance.new("BodyGyro", root)

        bodyVelocity.MaxForce = Vector3.new(9000000000, 9000000000, 9000000000)
        bodyGyro.MaxTorque = Vector3.new(9000000000, 9000000000, 9000000000)

        if _G.flyConn then
            _G.flyConn:Disconnect()
        end

        _G.flyConn = RunService.RenderStepped:Connect(function()
            local camera = workspace.CurrentCamera
            local moveVector = Vector3.new()

            if UserInputService:IsKeyDown(Enum.KeyCode.W) then
                moveVector += camera.CFrame.LookVector
            end
            if UserInputService:IsKeyDown(Enum.KeyCode.S) then
                moveVector -= camera.CFrame.LookVector
            end
            if UserInputService:IsKeyDown(Enum.KeyCode.A) then
                moveVector -= camera.CFrame.RightVector
            end
            if UserInputService:IsKeyDown(Enum.KeyCode.D) then
                moveVector += camera.CFrame.RightVector
            end

            bodyVelocity.Velocity = moveVector * (_G.flySpeed or 50)
            bodyGyro.CFrame = camera.CFrame
        end)

        _G.bv = bodyVelocity
        _G.bg = bodyGyro
    end
end

LocalPlayer.CharacterAdded:Connect(onCharacterAdded)
if LocalPlayer.Character then
    task.spawn(onCharacterAdded, LocalPlayer.Character)
end

local antiAFKEnabled = true
task.spawn(function()
    while true do
        task.wait(55)
        if antiAFKEnabled then
            VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.ButtonL3, false, game)
            task.wait(0.1)
            VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.ButtonL3, false, game)
        end
    end
end)

MiscTab:CreateToggle({
    Name = "Anti-AFK",
    CurrentValue = true,
    Callback = function(state)
        antiAFKEnabled = state
    end
})

local noclipEnabled = false
RunService.Heartbeat:Connect(function()
    if not noclipEnabled then return end

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

MiscTab:CreateToggle({
    Name = "Noclip",
    CurrentValue = false,
    Callback = function(state)
        noclipEnabled = state
    end
})

local godModeEnabled = false
task.spawn(function()
    while true do
        task.wait(0.3)
        if godModeEnabled then
            local remotes = game:GetService("ReplicatedStorage"):FindFirstChild("RemoteEvents")
            local damageRemote = remotes and remotes:FindFirstChild("DamagePlayer")
            if damageRemote then
                pcall(function()
                    damageRemote:FireServer(-999999999)
                end)
            end
        end
    end
end)

MiscTab:CreateToggle({
    Name = "God Mode",
    CurrentValue = false,
    Callback = function(state)
        godModeEnabled = state
    end
})

local killAuraEnabled = false
local auraRange = 100
local weaponIDs = {
    ["Old Axe"] = "1_8982038982",
    ["Good Axe"] = "112_8982038982",
    ["Strong Axe"] = "116_8982038982",
    Chainsaw = "647_8992824875",
    Spear = "196_8999010016"
}

local function getWeapon()
    local inventory = game:GetService("Players").LocalPlayer:FindFirstChild("Inventory")
    if not inventory then return nil, nil end

    for name, id in pairs(weaponIDs) do
        local item = inventory:FindFirstChild(name)
        if item then
            return item, id
        end
    end
    return nil, nil
end

task.spawn(function()
    while true do
        task.wait(0.1)
        if killAuraEnabled then
            local char = game:GetService("Players").LocalPlayer.Character
            local root = char and char:FindFirstChild("HumanoidRootPart")
            local weaponItem, weaponID = getWeapon()
            
            if root and weaponItem and weaponID then
                local remotes = game:GetService("ReplicatedStorage"):FindFirstChild("RemoteEvents")
                if remotes then
                    local equipRemote = remotes:FindFirstChild("EquipItemHandle")
                    local damageRemote = remotes:FindFirstChild("ToolDamageObject")

                    if equipRemote then
                        equipRemote:FireServer("FireAllClients", weaponItem)
                    end

                    if damageRemote then
                        for _, child in ipairs(workspace.Characters:GetChildren()) do
                            if child:IsA("Model") and child ~= char then
                                local part = child:FindFirstChildWhichIsA("BasePart")
                                if part and (part.Position - root.Position).Magnitude <= auraRange then
                                    pcall(function()
                                        damageRemote:InvokeServer(child, weaponItem, weaponID, CFrame.new(part.Position))
                                    end)
                                end
                            end
                        end
                    end
                end
            end
        end
    end
end)

MainTab:CreateToggle({
    Name = "Kill Aura",
    CurrentValue = false,
    Callback = function(state)
        killAuraEnabled = state
        if state then
            Rayfield:Notify({
                Title = "Kill Aura",
                Content = "Make sure you have a weapon!",
                Duration = 3
            })
        end
    end
})

MainTab:CreateSlider({
    Name = "Aura Range",
    Range = {10, 500},
    Increment = 10,
    CurrentValue = 100,
    Callback = function(value)
        auraRange = value
    end
})

local autoFishEnabled = false
local lastFishTime = 0

task.spawn(function()
    while true do
        if not autoFishEnabled then
            task.wait(0.5)
        else
            task.wait()
            local playerGui = LocalPlayer:FindFirstChild("PlayerGui")
            if playerGui then
                playerGui = playerGui:FindFirstChild("FishingCatchFrame", true)
            end

            local isVisible = playerGui
            if playerGui then
                isVisible = playerGui.Visible
                if isVisible then
                    isVisible = playerGui.AbsoluteSize.Y > 50
                end
            end

            if isVisible then
                local timingBar = playerGui:FindFirstChild("TimingBar")
                if timingBar and timingBar.Visible then
                    local bar = timingBar:FindFirstChild("Bar")
                    local successArea = timingBar:FindFirstChild("SuccessArea")
                    
                    local isValid = bar
                    if bar then
                        isValid = successArea and bar.Visible and successArea.Visible
                    end

                    if isValid then
                        local barCenter = bar.AbsolutePosition.Y + bar.AbsoluteSize.Y / 2
                        local successY = successArea.AbsolutePosition.Y
                        local successEndY = successY + successArea.AbsoluteSize.Y

                        if successY <= barCenter and barCenter <= successEndY then
                            local currentTime = tick()
                            if currentTime - lastFishTime > 0.15 then
                                lastFishTime = currentTime
                                VirtualInputManager:SendMouseButtonEvent(0, 0, 0, true, game, 0)
                                VirtualInputManager:SendMouseButtonEvent(0, 0, 0, false, game, 0)
                            end
                        end
                    end
                end
            end
        end
    end
end)

MainTab:CreateToggle({
    Name = "Auto Fish",
    CurrentValue = false,
    Callback = function(state)
        autoFishEnabled = state
    end
})

local infiniteSaplingEnabled = false
local saplingDelay = 0.2

MainTab:CreateToggle({
    Name = "Infinite Sapling",
    CurrentValue = false,
    Callback = function(state)
        infiniteSaplingEnabled = state
    end
})

MainTab:CreateSlider({
    Name = "Sapling Delay",
    Range = {0.2, 2},
    Increment = 0.1,
    CurrentValue = 0.2,
    Callback = function(value)
        saplingDelay = value
    end
})

local function getSapling()
    for _, child in ipairs(Items:GetChildren()) do
        if child.Name == "Sapling" and child.PrimaryPart then
            return child
        end
    end
end

local function getGroundPosition(position)
    local filter = {}
    local raycastParams = RaycastParams.new()

    if Map then
        local ground = Map:FindFirstChild("Ground")
        local snow = Map:FindFirstChild("Snow")

        if ground then
            table.insert(filter, ground)
        end
        if snow then
            table.insert(filter, snow)
        end
    end

    if #filter == 0 then return nil end

    raycastParams.FilterDescendantsInstances = filter
    raycastParams.FilterType = Enum.RaycastFilterType.Include
    raycastParams.IgnoreWater = true

    local result = workspace:Raycast(position, Vector3.new(0, -80, 0), raycastParams)
    return result and result.Position
end

local plantRemote
task.spawn(function()
    task.wait(1)
    for _, descendant in ipairs(ReplicatedStorage:GetDescendants()) do
        local isPlant = descendant.Name:lower():find("plant")
        if isPlant then
            isPlant = descendant:IsA("RemoteEvent")
            if not isPlant then
                isPlant = descendant:IsA("RemoteFunction")
            end
        end

        if isPlant then
            plantRemote = descendant
            return
        end
    end
end)

local saplingOffsets = {}
for i = -2, 2 do
    for j = -2, 2 do
        table.insert(saplingOffsets, Vector3.new(i * 0.3, 0, j * 0.3))
    end
end

local offsetIndex = 0
task.spawn(function()
    task.wait(2)
    local currentSapling
    while true do
        task.wait(0.05)
        if not infiniteSaplingEnabled then
            task.wait(0.3)
        else
            local root = getRootPart()
            if not root then
                task.wait(0.5)
            else
                currentSapling = currentSapling or getSapling()
                if not currentSapling then
                    task.wait(0.5)
                else
                    local groundPos = getGroundPosition(root.Position + Vector3.new(0, 5, 0))
                    if groundPos and plantRemote then
                        offsetIndex = offsetIndex % #saplingOffsets + 1
                        local placePosition = groundPos + saplingOffsets[offsetIndex] + Vector3.new(0, 0.25, 0)

                        pcall(function()
                            if plantRemote:IsA("RemoteEvent") then
                                plantRemote:FireServer(currentSapling, placePosition)
                                return
                            end
                            plantRemote:InvokeServer(currentSapling, placePosition)
                        end)
                    end
                    task.wait(saplingDelay)
                end
            end
        end
    end
end)

_G.walkSpeed = 16
_G.speedEnabled = false

PlayerTab:CreateToggle({
    Name = "Custom WalkSpeed",
    CurrentValue = false,
    Callback = function(state)
        _G.speedEnabled = state
    end
})

PlayerTab:CreateSlider({
    Name = "WalkSpeed",
    Range = {16, 300},
    Increment = 1,
    CurrentValue = 16,
    Callback = function(value)
        _G.walkSpeed = value
    end
})

task.spawn(function()
    task.wait(2)
    while true do
        task.wait(0.15)
        if _G.speedEnabled then
            local humanoid = getHumanoid()
            if humanoid and humanoid.WalkSpeed ~= _G.walkSpeed then
                humanoid.WalkSpeed = _G.walkSpeed
            end
        end
    end
end)

local infiniteJumpEnabled = false
PlayerTab:CreateToggle({
    Name = "Infinite Jump",
    CurrentValue = false,
    Callback = function(state)
        infiniteJumpEnabled = state
    end
})

UserInputService.JumpRequest:Connect(function()
    if infiniteJumpEnabled then
        local humanoid = getHumanoid()
        if humanoid then
            humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
        end
    end
end)

_G.flySpeed = 50
_G.flyEnabled = false

PlayerTab:CreateToggle({
    Name = "Fly",
    CurrentValue = false,
    Callback = function(state)
        _G.flyEnabled = state
        local char = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
        local root = char:WaitForChild("HumanoidRootPart")

        if state then
            local bodyVelocity = Instance.new("BodyVelocity", root)
            local bodyGyro = Instance.new("BodyGyro", root)

            bodyVelocity.MaxForce = Vector3.new(9000000000, 9000000000, 9000000000)
            bodyGyro.MaxTorque = Vector3.new(9000000000, 9000000000, 9000000000)

            if _G.flyConn then
                _G.flyConn:Disconnect()
            end

            _G.flyConn = RunService.RenderStepped:Connect(function()
                local camera = workspace.CurrentCamera
                local moveVector = Vector3.new()

                if UserInputService:IsKeyDown(Enum.KeyCode.W) then
                    moveVector += camera.CFrame.LookVector
                end
                if UserInputService:IsKeyDown(Enum.KeyCode.S) then
                    moveVector -= camera.CFrame.LookVector
                end
                if UserInputService:IsKeyDown(Enum.KeyCode.A) then
                    moveVector -= camera.CFrame.RightVector
                end
                if UserInputService:IsKeyDown(Enum.KeyCode.D) then
                    moveVector += camera.CFrame.RightVector
                end

                bodyVelocity.Velocity = moveVector * _G.flySpeed
                bodyGyro.CFrame = camera.CFrame
            end)

            _G.bv = bodyVelocity
            _G.bg = bodyGyro
        else
            if _G.flyConn then
                _G.flyConn:Disconnect()
            end
            if _G.bv then
                _G.bv:Destroy()
            end
            if _G.bg then
                _G.bg:Destroy()
            end
        end
    end
})

PlayerTab:CreateSlider({
    Name = "Fly Speed",
    Range = {10, 300},
    Increment = 5,
    CurrentValue = 50,
    Callback = function(value)
        _G.flySpeed = value
    end
})

local mobESPEnabled = false
local itemESPEnabled = false
local chestESPEnabled = false
local playerESPEnabled = false

local chestESPObjects = {}
local playerESPObjects = {}
local chestList = {}
local lastChestUpdate = 0
local lastPlayerUpdate = 0

local function clearESPObjects(list)
    for _, obj in pairs(list) do
        if obj and obj.Parent then
            obj:Destroy()
        end
    end
    table.clear(list)
end

local function clearPlayerHighlights()
    for _, player in ipairs(Players:GetPlayers()) do
        if player ~= LocalPlayer and player.Character then
            local highlight = player.Character:FindFirstChild("PlayerHighlight")
            if highlight then
                highlight:Destroy()
            end
        end
    end
end

task.spawn(function()
    task.wait(3)
    while true do
        task.wait(not chestESPEnabled and 8 or 4)
        if chestESPEnabled then
            chestList = {}
            for _, child in ipairs(Items:GetChildren()) do
                if child.Name:lower():find("chest") then
                    table.insert(chestList, child)
                end
            end
        end
    end
end)

task.spawn(function()
    task.wait(3)
    while true do
        task.wait(2)
        if mobESPEnabled or itemESPEnabled or chestESPEnabled or playerESPEnabled then
            local root = getRootPart()
            if root then
                local position = root.Position

                if mobESPEnabled then
                    for _, child in ipairs(Characters:GetChildren()) do
                        local part = getPrimaryPart(child)
                        if part then
                            if (part.Position - position).Magnitude <= 250 then
                                if not child:FindFirstChild("Highlight") then
                                    local highlight = Instance.new("Highlight", child)
                                    highlight.FillColor = Color3.fromRGB(255, 50, 50)
                                    highlight.OutlineColor = Color3.fromRGB(255, 0, 0)
                                end
                            else
                                local highlight = child:FindFirstChild("Highlight")
                                if highlight then
                                    highlight:Destroy()
                                end
                            end
                        end
                    end
                else
                    for _, child in ipairs(Characters:GetChildren()) do
                        local highlight = child:FindFirstChild("Highlight")
                        if highlight then
                            highlight:Destroy()
                        end
                    end
                end

                if itemESPEnabled then
                    for _, child in ipairs(Items:GetChildren()) do
                        if not child:FindFirstChild("Highlight") then
                            local highlight = Instance.new("Highlight", child)
                            highlight.FillColor = Color3.fromRGB(50, 255, 50)
                            highlight.OutlineColor = Color3.fromRGB(0, 200, 0)
                        end
                    end
                else
                    for _, child in ipairs(Items:GetChildren()) do
                        local highlight = child:FindFirstChild("Highlight")
                        if highlight then
                            highlight:Destroy()
                        end
                    end
                end

                if chestESPEnabled then
                    local time = tick()
                    if time - lastChestUpdate >= 4 then
                        lastChestUpdate = time
                        clearESPObjects(chestESPObjects)
                        for _, chest in ipairs(chestList) do
                            local part = getPrimaryPart(chest)
                            if part then
                                local magnitude = (part.Position - position).Magnitude
                                if magnitude <= 300 then
                                    local billboard = Instance.new("BillboardGui")
                                    billboard.Size = UDim2.new(0, 100, 0, 40)
                                    billboard.AlwaysOnTop = true
                                    billboard.Adornee = part

                                    local label = Instance.new("TextLabel", billboard)
                                    label.Size = UDim2.new(1, 0, 1, 0)
                                    label.BackgroundTransparency = 1
                                    label.Text = "Chest [" .. math.floor(magnitude) .. "m]"
                                    label.TextColor3 = Color3.fromRGB(255, 255, 0)
                                    label.TextStrokeTransparency = 0
                                    label.Font = Enum.Font.GothamBold
                                    label.TextScaled = true
                                    billboard.Parent = part
                                    table.insert(chestESPObjects, billboard)
                                end
                            end
                        end
                    end
                elseif #chestESPObjects > 0 then
                    clearESPObjects(chestESPObjects)
                end

                if playerESPEnabled then
                    local time = tick()
                    if time - lastPlayerUpdate >= 4 then
                        lastPlayerUpdate = time
                        clearESPObjects(playerESPObjects)
                        clearPlayerHighlights()

                        for _, player in ipairs(Players:GetPlayers()) do
                            if player ~= LocalPlayer and player.Character then
                                local rootPart = player.Character:FindFirstChild("HumanoidRootPart")
                                if not player.Character:FindFirstChild("PlayerHighlight") then
                                    local highlight = Instance.new("Highlight", player.Character)
                                    highlight.Name = "PlayerHighlight"
                                    highlight.FillColor = Color3.fromRGB(50, 150, 255)
                                    highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
                                    highlight.FillTransparency = 0.5
                                end

                                if rootPart then
                                    local magnitude = (rootPart.Position - position).Magnitude
                                    local billboard = Instance.new("BillboardGui")
                                    billboard.Size = UDim2.new(0, 130, 0, 40)
                                    billboard.AlwaysOnTop = true
                                    billboard.Adornee = rootPart
                                    billboard.StudsOffset = Vector3.new(0, 3, 0)

                                    local label = Instance.new("TextLabel", billboard)
                                    label.Size = UDim2.new(1, 0, 1, 0)
                                    label.BackgroundTransparency = 1
                                    label.Text = player.Name .. " [" .. math.floor(magnitude) .. "m]"
                                    label.TextColor3 = Color3.fromRGB(100, 200, 255)
                                    label.TextStrokeTransparency = 0
                                    label.Font = Enum.Font.GothamBold
                                    label.TextScaled = true
                                    billboard.Parent = rootPart
                                    table.insert(playerESPObjects, billboard)
                                end
                            end
                        end
                    end
                elseif #playerESPObjects > 0 then
                    clearESPObjects(playerESPObjects)
                    clearPlayerHighlights()
                end
            end
        end
    end
end)

ESPTab:CreateToggle({
    Name = "Mob ESP",
    CurrentValue = false,
    Callback = function(state)
        mobESPEnabled = state
    end
})

ESPTab:CreateToggle({
    Name = "Item ESP",
    CurrentValue = false,
    Callback = function(state)
        itemESPEnabled = state
    end
})

ESPTab:CreateToggle({
    Name = "Chest ESP",
    CurrentValue = false,
    Callback = function(state)
        chestESPEnabled = state
    end
})

ESPTab:CreateToggle({
    Name = "Player ESP",
    CurrentValue = false,
    Callback = function(state)
        playerESPEnabled = state
    end
})

local function findMapObject(name)
    if not Map then return nil end
    for _, descendant in ipairs(Map:GetDescendants()) do
        if not descendant.Name:lower():find(name) then
            continue
        end
        local obj = descendant:IsA("Model") and getPrimaryPart(descendant)
        if not obj then
            obj = descendant:IsA("BasePart") and descendant
        end
        if obj then
            return obj
        end
    end
end

TeleportTab:CreateButton({
    Name = "Campfire",
    Callback = function()
        local obj = findMapObject("mainfire") or findMapObject("campfire")
        if obj then
            teleportTo(obj)
        else
            Rayfield:Notify({
                Title = "Error",
                Content = "Not found",
                Duration = 2
            })
        end
    end
})

TeleportTab:CreateButton({
    Name = "Stronghold",
    Callback = function()
        local stronghold = workspace:FindFirstChild("Map")
        if stronghold then
            stronghold = workspace.Map:FindFirstChild("Landmarks")
            if stronghold then
                stronghold = workspace.Map.Landmarks:FindFirstChild("Stronghold")
                if stronghold then
                    stronghold = workspace.Map.Landmarks.Stronghold:FindFirstChild("Functional")
                    if stronghold then
                        stronghold = workspace.Map.Landmarks.Stronghold.Functional:FindFirstChild("EntryDoors")
                        if stronghold then
                            stronghold = workspace.Map.Landmarks.Stronghold.Functional.EntryDoors:FindFirstChild("DoorRight")
                            if stronghold then
                                stronghold = workspace.Map.Landmarks.Stronghold.Functional.EntryDoors.DoorRight:FindFirstChild("Model")
                            end
                        end
                    end
                end
            end
        end

        if stronghold then
            local part = stronghold:GetChildren()[5]
            if part and part:IsA("BasePart") then
                teleportTo(part)
                return
            end
        else
            Rayfield:Notify({
                Title = "Error",
                Content = "Stronghold not found",
                Duration = 2
            })
        end
    end
})

local dropdownUpdateDelay = 0
local function setupDropdownRefresh(dropdown, getOptionsFunc, refreshDelay)
    dropdownUpdateDelay += 0.5
    local delayTime = dropdownUpdateDelay

    task.spawn(function()
        task.wait(delayTime)
        local currentOptions = {}
        while true do
            task.wait(refreshDelay)
            local newOptions = getOptionsFunc()
            local changed = #newOptions ~= #currentOptions

            if not changed then
                for i, opt in ipairs(newOptions) do
                    if opt ~= currentOptions[i] then
                        changed = true
                        break
                    end
                end
            end

            if changed then
                dropdown:Refresh(newOptions)
                currentOptions = newOptions
            end
        end
    end)
end

local selectedChest
local function isChestOpen(chest)
    local opened = chest:FindFirstChild("Opened")
    if opened then
        opened = chest.Opened.Value
    end
    if opened then return true end

    local isOpen = chest:FindFirstChild("IsOpen")
    if isOpen then
        isOpen = chest.IsOpen.Value
    end
    if isOpen then return true end

    local lid = chest:FindFirstChild("Lid") or chest:FindFirstChild("ChestLid")
    if lid then
        lid = lid:IsA("BasePart") and lid.Transparency > 0.5
    end
    return lid
end

local chestDropdown = TeleportTab:CreateDropdown({
    Name = "Select Chest",
    Options = {},
    Callback = function(options)
        selectedChest = options[1]
    end
})

local chestLookup = {}
setupDropdownRefresh(chestDropdown, function()
    local counts = {}
    local optionList = {}
    chestLookup = {}

    for _, child in ipairs(Items:GetChildren()) do
        local isChest = child:IsA("Model")
        if isChest then
            isChest = child.Name:lower():find("chest") and not isChestOpen(child)
        end

        if isChest then
            local name = "Chest " .. (child.Name:match("%d+") or "?")
            counts[name] = (counts[name] or 0) + 1
            local optionName = name .. " #" .. counts[name]
            chestLookup[optionName] = child
            table.insert(optionList, optionName)
        end
    end

    table.sort(optionList)
    return optionList
end, 3)

TeleportTab:CreateButton({
    Name = "Go to Chest",
    Callback = function()
        local chest = chestLookup[selectedChest]
        if chest then
            teleportTo(getPrimaryPart(chest))
        end
    end
})

local selectedPlayer
local playerDropdown = TeleportTab:CreateDropdown({
    Name = "Select Player",
    Options = {},
    Callback = function(options)
        selectedPlayer = options[1]
    end
})

setupDropdownRefresh(playerDropdown, function()
    local players = {}
    for _, player in ipairs(Players:GetPlayers()) do
        if player ~= LocalPlayer then
            table.insert(players, player.Name)
        end
    end
    return players
end, 4)

TeleportTab:CreateButton({
    Name = "Go to Player",
    Callback = function()
        local player = Players:FindFirstChild(selectedPlayer)
        if player and player.Character then
            teleportTo(player.Character:FindFirstChild("HumanoidRootPart"))
        end
    end
})

local selectedMob
local mobDropdown = TeleportTab:CreateDropdown({
    Name = "Select Mob",
    Options = {},
    Callback = function(options)
        selectedMob = options[1]
    end
})

setupDropdownRefresh(mobDropdown, function()
    local mobs = {}
    for _, child in ipairs(Characters:GetChildren()) do
        table.insert(mobs, child.Name)
    end
    return mobs
end, 4)

TeleportTab:CreateButton({
    Name = "Go to Mob",
    Callback = function()
        for _, child in ipairs(Characters:GetChildren()) do
            if child.Name == selectedMob then
                teleportTo(getPrimaryPart(child))
                return
            end
        end
    end
})

local selectedItem
local itemDropdown = ItemsTab:CreateDropdown({
    Name = "Select Item",
    Options = {},
    CurrentOption = {},
    Callback = function(options)
        selectedItem = options[1]
    end
})

setupDropdownRefresh(itemDropdown, function()
    local items = {}
    for _, child in ipairs(Items:GetChildren()) do
        local isValid = not child.Name:lower():find("chest")
        if isValid then
            isValid = not table.find(items, child.Name)
        end
        if isValid then
            table.insert(items, child.Name)
        end
    end
    table.sort(items)
    return items
end, 4)

ItemsTab:CreateButton({
    Name = "Bring Item (All)",
    Callback = function()
        local root = getRootPart()
        if not root then return end

        if not selectedItem then
            Rayfield:Notify({
                Title = "Items",
                Content = "Select an item first!",
                Duration = 2
            })
            return
        end

        local count = 0
        for _, child in ipairs(Items:GetChildren()) do
            if child.Name == selectedItem then
                count += 1
                if count > 25 then
                    break
                end

                pcall(function()
                    local primary = child.PrimaryPart
                    if not primary then
                        primary = child:FindFirstChildWhichIsA("BasePart")
                        if not primary then
                            primary = child:FindFirstChild("Handle")
                        end
                    end

                    local part = primary
                    if not part then return end

                    if not child.PrimaryPart then
                        pcall(function()
                            child.PrimaryPart = part
                        end)
                    end

                    local position = root.CFrame + Vector3.new(0, count * 2 + 3, 0)
                    local startDrag, stopDrag = getDragRemotes()
                    if not startDrag or not stopDrag then return end

                    startDrag:FireServer(child)
                    task.wait(0.05)

                    if child.PrimaryPart then
                        child:SetPrimaryPartCFrame(position)
                    else
                        part.CFrame = position
                    end

                    task.wait(0.05)
                    stopDrag:FireServer(child)
                    task.wait(0.1)
                end)
            end
        end

        local message
        if count > 0 then
            message = "Brought " .. count .. "x " .. selectedItem
        else
            message = selectedItem .. " not found in world"
        end

        Rayfield:Notify({
            Title = "Items",
            Content = message,
            Duration = 3
        })
    end
})

local campfirePosition = Vector3.new(0, 19, 0)
local workbenchPosition = Vector3.new(21, 16, -5)
local autoCampfire = {}
local autoCook = {}
local autoWorkbench = {}
local autoBiofuel = {}

local function createAutoSection(tab, sectionName, items, stateTable)
    tab:CreateSection(sectionName)

    for _, item in ipairs(items) do
        tab:CreateToggle({
            Name = item,
            CurrentValue = false,
            Callback = function(state)
                stateTable[item] = state
            end
        })
    end

    tab:CreateButton({
        Name = "Enable All",
        Callback = function()
            for _, item in ipairs(items) do
                stateTable[item] = true
            end
        end
    })

    tab:CreateButton({
        Name = "Disable All",
        Callback = function()
            for _, item in ipairs(items) do
                stateTable[item] = false
            end
        end
    })
end

createAutoSection(AutoTab, "Auto Feed Campfire", {
    "Log",
    "Coal",
    "Fuel Canister",
    "Oil Barrel",
    "Biofuel"
}, autoCampfire)

createAutoSection(AutoTab, "Auto Cook", {
    "Morsel",
    "Steak"
}, autoCook)

createAutoSection(AutoTab, "Auto Workbench", {
    "UFO Junk",
    "UFO Component",
    "Old Car Engine",
    "Broken Fan",
    "Old Microwave",
    "Bolt",
    "Sheet Metal",
    "Old Radio",
    "Tyre",
    "Washing Machine",
    "Broken Microwave",
    "Log"
}, autoWorkbench)

createAutoSection(AutoTab, "Auto Biofuel Processor", {
    "Carrot",
    "Cooked Morsel",
    "Morsel",
    "Steak",
    "Cooked Steak",
    "Log"
}, autoBiofuel)

task.spawn(function()
    while true do
        task.wait(2)
        for item, state in pairs(autoCampfire) do
            if state then
                for _, child in ipairs(Items:GetChildren()) do
                    if item == child.Name then
                        bringItem(child, campfirePosition)
                    end
                end
            end
        end
    end
end)

task.spawn(function()
    while true do
        task.wait(2.5)
        for item, state in pairs(autoCook) do
            if state then
                for _, child in ipairs(Items:GetChildren()) do
                    if item == child.Name then
                        bringItem(child, campfirePosition)
                    end
                end
            end
        end
    end
end)

task.spawn(function()
    while true do
        task.wait(2.5)
        for item, state in pairs(autoWorkbench) do
            if state then
                for _, child in ipairs(Items:GetChildren()) do
                    if item == child.Name then
                        bringItem(child, workbenchPosition)
                    end
                end
            end
        end
    end
end)

task.spawn(function()
    local biofuelPosition
    while true do
        task.wait(2)
        if not biofuelPosition then
            local structures = workspace:FindFirstChild("Structures")
            local processor = structures and structures:FindFirstChild("Biofuel Processor")
            if processor then
                processor = processor:FindFirstChild("Part")
            end
            if processor then
                biofuelPosition = processor.Position + Vector3.new(0, 5, 0)
            end
        end

        if biofuelPosition then
            for item, state in pairs(autoBiofuel) do
                if state then
                    for _, child in ipairs(Items:GetChildren()) do
                        if item == child.Name then
                            bringItem(child, biofuelPosition)
                        end
                    end
                end
            end
        end
    end
end)

UserInputService.InputBegan:Connect(function(input, gameProcessed)
    if not gameProcessed and input.KeyCode == Enum.KeyCode.G then
        Rayfield:ToggleUI()
    end
end)

Rayfield:Notify({
    Title = "Gooner Hub v2",
    Content = "Loaded! Press G to toggle UI",
    Duration = 4
})

Features & Information

Kill Aura Auto Campire Auto Fish Auto Sapling Auto Fuel Auo Materials Teleport all items Teleport Chests Teleport to Stronghold Auto Workbench Auto biofuel God Mode No Clip EspEnerg

Community Comments (0)

No comments yet for this script.

More Scripts for 99 Nights in the Forest 🔦