kjjjkjpro  script
Key Required

kjjjkjpro script

99 Nights in the Forest 🔦kjjjkjprokjjjkjpro 3K views 17.1K executesUpdated Sep 7, 2026
0.0/ 5(1 votes)
010% Positive
Lua Script•1396 lines (53129 chars)
--[[
    99 NIGHTS IN THE FOREST - ULTIMATE CHEAT GUI (PC-ONLY)
    MERGED & FIXED VERSION
    Features:
    - Dream Cheats: Fly, Noclip, God Mode, Speed Hack, Teleport, Fling, ESP, Aimbot, etc.
    - 99 Nights Specific: Auto Fuel, Item Bringer, Auto Food, Auto Heal, Kill Aura, etc.
    - All items bringer (food, fuel, weapons, bandages, wood, coal, scrap, etc.)
    - Auto fuel system (logs, coal, fuel canisters, biofuel, oil barrels)
    - Close button & V key to open/close menu
    - No mobile support – PC only
--]]

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local TeleportService = game:GetService("TeleportService")
local Workspace = game:GetService("Workspace")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StarterGui = game:GetService("StarterGui")
local VirtualUser = game:GetService("VirtualUser")
local CollectionService = game:GetService("CollectionService")
local Lighting = game:GetService("Lighting")

local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local rootPart = character:WaitForChild("HumanoidRootPart")

-- === STATE VARIABLES ===
local state = {
    -- Dream Cheats
    fly = false,
    noclip = false,
    speed = 16,
    jumpPower = 50,
    gravity = 196.2,
    flingPower = 5000,
    esp = false,
    aimbot = false,
    silentAim = false,
    autoClick = false,
    teleportAllBlue = false,
    godMode = false,
    infiniteJump = false,
    autoFarm = false,
    speedHack = false,
    antiKick = false,
    btools = false,
    chatSpam = false,
    freecam = false,
    noFall = false,
    wallhack = false,
    flySpeed = 50,
    selectedPlayer = nil,
    teleportTarget = nil,
    flingTarget = nil,
    rainbow = false,
    darkMode = false,
    soundEffects = false,
    antiAFK = false,

    -- 99 Nights Specific
    autoFuel = false,
    autoFood = false,
    autoHeal = false,
    itemBringer = false,
    bringAllItems = false,
    killAura = false,
    autoWood = false,
    autoScrap = false,
    chestESP = false,
    enemyESP = false,
    childESP = false,
    teleportToChests = false,
    teleportToChildren = false,
    nightVision = false,
    removeFog = false,
    autoCook = false,
    noDamage = false,
    autoDiamonds = false,
    autoLoot = false,
    autoCraft = false,
    autoUpgrade = false,
    instantHeal = false,
    infiniteStamina = false,
    autoRepair = false,
    autoCollect = false,
    teleportToSpawn = false,
    teleportToBase = false,
    
    -- Missing variables added
    flingMode = false,
    itemESP = false,
}

-- === FUEL ITEMS DATABASE ===
local FUEL_ITEMS = {
    "Log", "Logs", "Wood", "Coal", "FuelCanister", "Fuel Canister",
    "Biofuel", "BioFuel", "OilBarrel", "Oil Barrel", "Gasoline",
    "GasCan", "Gas Can", "Propane", "PropaneTank", "Kerosene",
    "LighterFluid", "Charcoal", "PineCone", "Stick", "Branch",
    "Kindling", "Paper", "Cardboard", "Cloth", "Fabric"
}

-- === ITEMS DATABASE FOR BRINGER ===
local BRING_ITEMS = {
    -- Fuel
    "Log", "Logs", "Wood", "Coal", "FuelCanister", "Fuel Canister",
    "Biofuel", "BioFuel", "OilBarrel", "Oil Barrel", "Gasoline",
    -- Food
    "Apple", "Berry", "Berries", "Meat", "RawMeat", "CookedMeat",
    "Fish", "RawFish", "CookedFish", "Bread", "CannedFood",
    "MRE", "Ration", "EnergyBar", "TrailMix", "Soup",
    -- Weapons
    "Axe", "Hatchet", "Knife", "Machete", "Sword", "Spear",
    "Bow", "Crossbow", "Pistol", "Revolver", "Rifle", "Shotgun",
    "Chainsaw", "PoliceShield", "RayGun", "ElementalStaff",
    -- Medical
    "Bandage", "Bandages", "Medkit", "MedKit", "FirstAid",
    "Antidote", "Painkiller", "Stimulant", "Adrenaline",
    -- Materials
    "Scrap", "Scraps", "Metal", "Iron", "Steel", "Copper",
    "CultistGem", "ForestGem", "Diamond", "Crystal",
    -- Tools
    "Hammer", "Wrench", "Screwdriver", "Pliers", "Wire",
    "Rope", "DuctTape", "Glue", "Nail", "Screw",
    -- Armor
    "Helmet", "Chestplate", "Leggings", "Boots", "Shield",
    "MammothHelmet", "CyborgSuit",
    -- Misc
    "Map", "Compass", "Flashlight", "OldFlashlight", "Radio",
    "BrokenFan", "Bolt", "SheetMetal", "Microwave",
}

-- === GUI CREATION ===
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "99NightsCheatGUI"
screenGui.ResetOnSpawn = false
screenGui.Parent = player.PlayerGui

-- Main Frame
local mainFrame = Instance.new("Frame")
mainFrame.Name = "MainFrame"
mainFrame.Size = UDim2.new(0, 480, 0, 650)
mainFrame.Position = UDim2.new(0.5, -240, 0.5, -325)
mainFrame.BackgroundColor3 = Color3.fromRGB(15, 15, 25)
mainFrame.BackgroundTransparency = 0.1
mainFrame.BorderSizePixel = 0
mainFrame.Parent = screenGui
mainFrame.Visible = false

local glass = Instance.new("Frame")
glass.Size = UDim2.new(1, 0, 1, 0)
glass.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
glass.BackgroundTransparency = 0.05
glass.BorderSizePixel = 0
glass.Parent = mainFrame

local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(0, 16)
corner.Parent = mainFrame

local shadow = Instance.new("Frame")
shadow.Size = UDim2.new(1, 0, 1, 0)
shadow.Position = UDim2.new(0, 8, 0, 8)
shadow.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
shadow.BackgroundTransparency = 0.5
shadow.BorderSizePixel = 0
shadow.ZIndex = 0
shadow.Parent = mainFrame
local shadowCorner = Instance.new("UICorner")
shadowCorner.CornerRadius = UDim.new(0, 16)
shadowCorner.Parent = shadow

local titleBar = Instance.new("Frame")
titleBar.Size = UDim2.new(1, 0, 0, 40)
titleBar.BackgroundColor3 = Color3.fromRGB(30, 20, 50)
titleBar.BackgroundTransparency = 0.3
titleBar.BorderSizePixel = 0
titleBar.Parent = mainFrame

local titleCorner = Instance.new("UICorner")
titleCorner.CornerRadius = UDim.new(0, 16)
titleCorner.Parent = titleBar

local titleLabel = Instance.new("TextLabel")
titleLabel.Size = UDim2.new(1, -60, 1, 0)
titleLabel.Position = UDim2.new(0, 10, 0, 0)
titleLabel.BackgroundTransparency = 1
titleLabel.Text = "🔥 99 NIGHTS ULTIMATE"
titleLabel.TextColor3 = Color3.fromRGB(255, 180, 50)
titleLabel.TextSize = 20
titleLabel.TextXAlignment = Enum.TextXAlignment.Left
titleLabel.Font = Enum.Font.GothamBold
titleLabel.Parent = titleBar

local closeBtn = Instance.new("TextButton")
closeBtn.Size = UDim2.new(0, 30, 0, 30)
closeBtn.Position = UDim2.new(1, -35, 0, 5)
closeBtn.BackgroundColor3 = Color3.fromRGB(200, 40, 40)
closeBtn.BackgroundTransparency = 0.3
closeBtn.Text = "✕"
closeBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
closeBtn.TextSize = 18
closeBtn.Font = Enum.Font.GothamBold
closeBtn.BorderSizePixel = 0
closeBtn.Parent = titleBar
local closeCorner = Instance.new("UICorner")
closeCorner.CornerRadius = UDim.new(0, 8)
closeCorner.Parent = closeBtn

local tabs = {"Dream", "99Nights", "Combat", "Teleport", "Fling", "Items", "Settings"}
local tabButtons = {}
local tabFrames = {}

local tabBar = Instance.new("Frame")
tabBar.Size = UDim2.new(1, 0, 0, 40)
tabBar.Position = UDim2.new(0, 0, 0, 40)
tabBar.BackgroundTransparency = 1
tabBar.Parent = mainFrame

local scrollTabs = Instance.new("ScrollingFrame")
scrollTabs.Size = UDim2.new(1, 0, 1, 0)
scrollTabs.BackgroundTransparency = 1
scrollTabs.BorderSizePixel = 0
scrollTabs.ScrollBarThickness = 0
scrollTabs.CanvasSize = UDim2.new(0, #tabs * 90, 0, 0)
scrollTabs.Parent = tabBar

local tabLayout = Instance.new("UIListLayout")
tabLayout.FillDirection = Enum.FillDirection.Horizontal
tabLayout.Padding = UDim.new(0, 4)
tabLayout.Parent = scrollTabs

local contentArea = Instance.new("Frame")
contentArea.Size = UDim2.new(1, -20, 1, -90)
contentArea.Position = UDim2.new(0, 10, 0, 85)
contentArea.BackgroundTransparency = 1
contentArea.Parent = mainFrame

for i, tabName in ipairs(tabs) do
    local btn = Instance.new("TextButton")
    btn.Size = UDim2.new(0, 80, 0, 30)
    btn.BackgroundColor3 = Color3.fromRGB(40, 30, 60)
    btn.BackgroundTransparency = 0.5
    btn.Text = tabName
    btn.TextColor3 = Color3.fromRGB(200, 200, 255)
    btn.TextSize = 13
    btn.Font = Enum.Font.GothamSemibold
    btn.BorderSizePixel = 0
    btn.Parent = scrollTabs
    local btnCorner = Instance.new("UICorner")
    btnCorner.CornerRadius = UDim.new(0, 8)
    btnCorner.Parent = btn

    local frame = Instance.new("ScrollingFrame")
    frame.Size = UDim2.new(1, 0, 1, 0)
    frame.BackgroundTransparency = 1
    frame.BorderSizePixel = 0
    frame.ScrollBarThickness = 4
    frame.ScrollBarImageColor3 = Color3.fromRGB(100, 80, 150)
    frame.CanvasSize = UDim2.new(0, 0, 0, 0)
    frame.Parent = contentArea
    frame.Visible = (i == 1)

    tabButtons[tabName] = btn
    tabFrames[tabName] = frame

    btn.MouseButton1Click:Connect(function()
        for _, f in pairs(tabFrames) do f.Visible = false end
        frame.Visible = true
        for _, b in pairs(tabButtons) do
            b.BackgroundColor3 = Color3.fromRGB(40, 30, 60)
        end
        btn.BackgroundColor3 = Color3.fromRGB(80, 50, 140)
    end)
end

tabButtons["Dream"].BackgroundColor3 = Color3.fromRGB(80, 50, 140)

-- === HELPER FUNCTIONS ===
local function createToggle(parent, labelText, stateKey, yPos, color)
    local frame = Instance.new("Frame")
    frame.Size = UDim2.new(1, -20, 0, 30)
    frame.Position = UDim2.new(0, 10, 0, yPos)
    frame.BackgroundTransparency = 1
    frame.Parent = parent

    local label = Instance.new("TextLabel")
    label.Size = UDim2.new(0.7, 0, 1, 0)
    label.BackgroundTransparency = 1
    label.Text = labelText
    label.TextColor3 = Color3.fromRGB(220, 220, 255)
    label.TextSize = 14
    label.TextXAlignment = Enum.TextXAlignment.Left
    label.Font = Enum.Font.Gotham
    label.Parent = frame

    local toggleBtn = Instance.new("TextButton")
    toggleBtn.Size = UDim2.new(0, 50, 0, 24)
    toggleBtn.Position = UDim2.new(1, -55, 0, 3)
    toggleBtn.BackgroundColor3 = Color3.fromRGB(60, 50, 80)
    toggleBtn.Text = "OFF"
    toggleBtn.TextColor3 = Color3.fromRGB(255, 100, 100)
    toggleBtn.TextSize = 12
    toggleBtn.Font = Enum.Font.GothamBold
    toggleBtn.BorderSizePixel = 0
    toggleBtn.Parent = frame
    local toggleCorner = Instance.new("UICorner")
    toggleCorner.CornerRadius = UDim.new(0, 6)
    toggleCorner.Parent = toggleBtn

    toggleBtn.MouseButton1Click:Connect(function()
        state[stateKey] = not state[stateKey]
        toggleBtn.Text = state[stateKey] and "ON" or "OFF"
        toggleBtn.BackgroundColor3 = state[stateKey] and Color3.fromRGB(40, 180, 80) or Color3.fromRGB(60, 50, 80)
        toggleBtn.TextColor3 = state[stateKey] and Color3.fromRGB(100, 255, 100) or Color3.fromRGB(255, 100, 100)
    end)

    return frame
end

local function createSlider(parent, labelText, stateKey, minVal, maxVal, defaultVal, yPos, suffix)
    local frame = Instance.new("Frame")
    frame.Size = UDim2.new(1, -20, 0, 40)
    frame.Position = UDim2.new(0, 10, 0, yPos)
    frame.BackgroundTransparency = 1
    frame.Parent = parent

    local label = Instance.new("TextLabel")
    label.Size = UDim2.new(0.6, 0, 0.5, 0)
    label.Position = UDim2.new(0, 0, 0, 0)
    label.BackgroundTransparency = 1
    label.Text = labelText
    label.TextColor3 = Color3.fromRGB(220, 220, 255)
    label.TextSize = 13
    label.TextXAlignment = Enum.TextXAlignment.Left
    label.Font = Enum.Font.Gotham
    label.Parent = frame

    local valueLabel = Instance.new("TextLabel")
    valueLabel.Size = UDim2.new(0.3, 0, 0.5, 0)
    valueLabel.Position = UDim2.new(0.7, 0, 0, 0)
    valueLabel.BackgroundTransparency = 1
    valueLabel.Text = tostring(defaultVal) .. (suffix or "")
    valueLabel.TextColor3 = Color3.fromRGB(200, 200, 255)
    valueLabel.TextSize = 13
    valueLabel.TextXAlignment = Enum.TextXAlignment.Right
    valueLabel.Font = Enum.Font.Gotham
    valueLabel.Parent = frame

    local slider = Instance.new("Frame")
    slider.Size = UDim2.new(0.9, 0, 0.3, 0)
    slider.Position = UDim2.new(0.05, 0, 0.6, 0)
    slider.BackgroundColor3 = Color3.fromRGB(40, 30, 60)
    slider.BorderSizePixel = 0
    slider.Parent = frame
    local sliderCorner = Instance.new("UICorner")
    sliderCorner.CornerRadius = UDim.new(0, 4)
    sliderCorner.Parent = slider

    local fill = Instance.new("Frame")
    fill.Size = UDim2.new((defaultVal - minVal) / (maxVal - minVal), 0, 1, 0)
    fill.BackgroundColor3 = Color3.fromRGB(200, 150, 50)
    fill.BorderSizePixel = 0
    fill.Parent = slider
    local fillCorner = Instance.new("UICorner")
    fillCorner.CornerRadius = UDim.new(0, 4)
    fillCorner.Parent = fill

    local dragging = false
    slider.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            dragging = true
            local pos = math.clamp((input.Position.X - slider.AbsolutePosition.X) / slider.AbsoluteSize.X, 0, 1)
            local val = minVal + (maxVal - minVal) * pos
            val = math.floor(val + 0.5) -- FIXED math.round
            state[stateKey] = val
            fill.Size = UDim2.new(pos, 0, 1, 0)
            valueLabel.Text = tostring(val) .. (suffix or "")
        end
    end)

    slider.InputEnded:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            dragging = false
        end
    end)

    slider.InputChanged:Connect(function(input)
        if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
            local pos = math.clamp((input.Position.X - slider.AbsolutePosition.X) / slider.AbsoluteSize.X, 0, 1)
            local val = minVal + (maxVal - minVal) * pos
            val = math.floor(val + 0.5) -- FIXED math.round
            state[stateKey] = val
            fill.Size = UDim2.new(pos, 0, 1, 0)
            valueLabel.Text = tostring(val) .. (suffix or "")
        end
    end)

    return frame
end

local function createButton(parent, labelText, callback, yPos, color)
    local btn = Instance.new("TextButton")
    btn.Size = UDim2.new(0.9, 0, 0, 32)
    btn.Position = UDim2.new(0.05, 0, 0, yPos)
    btn.BackgroundColor3 = color or Color3.fromRGB(80, 50, 140)
    btn.Text = labelText
    btn.TextColor3 = Color3.fromRGB(255, 255, 255)
    btn.TextSize = 14
    btn.Font = Enum.Font.GothamSemibold
    btn.BorderSizePixel = 0
    btn.Parent = parent
    local btnCorner = Instance.new("UICorner")
    btnCorner.CornerRadius = UDim.new(0, 8)
    btnCorner.Parent = btn

    btn.MouseButton1Click:Connect(callback)
    return btn
end

-- === BUILD DREAM TAB ===
local dreamFrame = tabFrames["Dream"]
local yPos = 5

createToggle(dreamFrame, "✈️ Fly", "fly", yPos)
yPos = yPos + 35
createToggle(dreamFrame, "🌀 NoClip", "noclip", yPos)
yPos = yPos + 35
createToggle(dreamFrame, "🛡️ God Mode", "godMode", yPos)
yPos = yPos + 35
createToggle(dreamFrame, "🦘 Infinite Jump", "infiniteJump", yPos)
yPos = yPos + 35
createToggle(dreamFrame, "💨 Speed Hack", "speedHack", yPos)
yPos = yPos + 35
createToggle(dreamFrame, "🔄 No Fall Damage", "noFall", yPos)
yPos = yPos + 35
createToggle(dreamFrame, "👁️ Freecam", "freecam", yPos)
yPos = yPos + 40

createSlider(dreamFrame, "🏃 Walk Speed", "speed", 8, 200, 16, yPos, "")
yPos = yPos + 45
createSlider(dreamFrame, "🦘 Jump Power", "jumpPower", 20, 200, 50, yPos, "")
yPos = yPos + 45
createSlider(dreamFrame, "🌍 Gravity", "gravity", 0, 500, 196.2, yPos, "")
yPos = yPos + 45
createSlider(dreamFrame, "✈️ Fly Speed", "flySpeed", 10, 200, 50, yPos, "")
yPos = yPos + 45

createButton(dreamFrame, "🎯 Reset Character", function()
    player.Character = nil
    player:LoadCharacter()
end, yPos, Color3.fromRGB(180, 50, 50))

dreamFrame.CanvasSize = UDim2.new(0, 0, 0, yPos + 60)

-- === BUILD 99 NIGHTS TAB ===
local nightsFrame = tabFrames["99Nights"]
yPos = 5

local nightsLabel = Instance.new("TextLabel")
nightsLabel.Size = UDim2.new(1, -20, 0, 25)
nightsLabel.Position = UDim2.new(0, 10, 0, yPos)
nightsLabel.BackgroundTransparency = 1
nightsLabel.Text = "🔥 99 NIGHTS IN THE FOREST - SURVIVAL CHEATS"
nightsLabel.TextColor3 = Color3.fromRGB(255, 200, 100)
nightsLabel.TextSize = 15
nightsLabel.TextXAlignment = Enum.TextXAlignment.Left
nightsLabel.Font = Enum.Font.GothamBold
nightsLabel.Parent = nightsFrame
yPos = yPos + 30

createToggle(nightsFrame, "🔥 Auto Fuel (Campfire)", "autoFuel", yPos)
yPos = yPos + 35
createToggle(nightsFrame, "🍖 Auto Food (Eat when hungry)", "autoFood", yPos)
yPos = yPos + 35
createToggle(nightsFrame, "💉 Auto Heal (Bandages/Medkits)", "autoHeal", yPos)
yPos = yPos + 35
createToggle(nightsFrame, "🪓 Auto Wood Collection", "autoWood", yPos)
yPos = yPos + 35
createToggle(nightsFrame, "🔧 Auto Scrap Collection", "autoScrap", yPos)
yPos = yPos + 35
createToggle(nightsFrame, "🍳 Auto Cook Food", "autoCook", yPos)
yPos = yPos + 35
createToggle(nightsFrame, "🛡️ No Damage (Invincible)", "noDamage", yPos)
yPos = yPos + 35
createToggle(nightsFrame, "💎 Auto Diamonds/Gems", "autoDiamonds", yPos)
yPos = yPos + 35
createToggle(nightsFrame, "🏃 Infinite Stamina", "infiniteStamina", yPos)
yPos = yPos + 35
createToggle(nightsFrame, "🔧 Auto Repair Structures", "autoRepair", yPos)
yPos = yPos + 35
createToggle(nightsFrame, "📦 Auto Loot (Nearby)", "autoLoot", yPos)
yPos = yPos + 35
createToggle(nightsFrame, "⚡ Instant Heal (Full Health)", "instantHeal", yPos)
yPos = yPos + 40

createButton(nightsFrame, "🔥 Feed Campfire (All Fuel)", function()
    local campfire = Workspace:FindFirstChild("Campfire") or Workspace:FindFirstChild("Fire")
    if campfire then
        for _, fuel in ipairs(FUEL_ITEMS) do
            local items = player.Backpack:GetChildren()
            for _, item in ipairs(items) do
                if item.Name:find(fuel) then
                    item.Parent = campfire
                end
            end
        end
    end
end, yPos, Color3.fromRGB(200, 100, 30))
yPos = yPos + 40

createButton(nightsFrame, "🔄 Skip Night", function()
    local dayCycle = Workspace:FindFirstChild("DayCycle") or Workspace:FindFirstChild("TimeOfDay")
    if dayCycle then
        dayCycle.Value = dayCycle.Value + 1
    end
end, yPos, Color3.fromRGB(100, 50, 200))

nightsFrame.CanvasSize = UDim2.new(0, 0, 0, yPos + 60)

-- === BUILD COMBAT TAB ===
local combatFrame = tabFrames["Combat"]
yPos = 5

createToggle(combatFrame, "👁️ ESP (All)", "esp", yPos)
yPos = yPos + 35
createToggle(combatFrame, "👁️ Chest ESP", "chestESP", yPos)
yPos = yPos + 35
createToggle(combatFrame, "👁️ Enemy ESP", "enemyESP", yPos)
yPos = yPos + 35
createToggle(combatFrame, "👁️ Lost Children ESP", "childESP", yPos)
yPos = yPos + 35
createToggle(combatFrame, "🎯 Aimbot", "aimbot", yPos)
yPos = yPos + 35
createToggle(combatFrame, "🔇 Silent Aim", "silentAim", yPos)
yPos = yPos + 35
createToggle(combatFrame, "💀 Kill Aura", "killAura", yPos)
yPos = yPos + 35
createToggle(combatFrame, "🖱️ Auto Click", "autoClick", yPos)
yPos = yPos + 35
createToggle(combatFrame, "🧱 B-Tools (Delete)", "btools", yPos)
yPos = yPos + 35
createToggle(combatFrame, "📢 Chat Spam", "chatSpam", yPos)
yPos = yPos + 35
createToggle(combatFrame, "🌙 Night Vision", "nightVision", yPos)
yPos = yPos + 35
createToggle(combatFrame, "🌫️ Remove Fog", "removeFog", yPos)
yPos = yPos + 40

createButton(combatFrame, "💀 Kill All Enemies", function()
    for _, enemy in ipairs(Workspace:GetDescendants()) do
        if enemy:IsA("Model") and enemy:FindFirstChild("Humanoid") and not enemy:IsA("Player") then
            enemy.Humanoid.Health = 0
        end
    end
end, yPos, Color3.fromRGB(200, 30, 30))
yPos = yPos + 40

createButton(combatFrame, "⚡ Explode All", function()
    for _, enemy in ipairs(Workspace:GetDescendants()) do
        if enemy:IsA("Model") and enemy:FindFirstChild("HumanoidRootPart") and not enemy:IsA("Player") then
            local part = enemy.HumanoidRootPart
            local explosion = Instance.new("Explosion")
            explosion.Position = part.Position
            explosion.BlastRadius = 20
            explosion.BlastPressure = 100000
            explosion.Parent = Workspace
        end
    end
end, yPos, Color3.fromRGB(200, 150, 30))

combatFrame.CanvasSize = UDim2.new(0, 0, 0, yPos + 60)

-- === BUILD TELEPORT TAB ===
local teleportFrame = tabFrames["Teleport"]
yPos = 5

local playerListFrame = Instance.new("Frame")
playerListFrame.Size = UDim2.new(1, -20, 0, 100)
playerListFrame.Position = UDim2.new(0, 10, 0, yPos)
playerListFrame.BackgroundColor3 = Color3.fromRGB(30, 20, 50)
playerListFrame.BackgroundTransparency = 0.5
playerListFrame.BorderSizePixel = 0
playerListFrame.Parent = teleportFrame
local playerListCorner = Instance.new("UICorner")
playerListCorner.CornerRadius = UDim.new(0, 8)
playerListCorner.Parent = playerListFrame

local playerListLabel = Instance.new("TextLabel")
playerListLabel.Size = UDim2.new(1, 0, 0, 25)
playerListLabel.BackgroundTransparency = 1
playerListLabel.Text = "🎯 Select Player:"
playerListLabel.TextColor3 = Color3.fromRGB(200, 200, 255)
playerListLabel.TextSize = 14
playerListLabel.Font = Enum.Font.Gotham
playerListLabel.Parent = playerListFrame

local playerListScroll = Instance.new("ScrollingFrame")
playerListScroll.Size = UDim2.new(1, 0, 1, -30)
playerListScroll.Position = UDim2.new(0, 0, 0, 28)
playerListScroll.BackgroundTransparency = 1
playerListScroll.BorderSizePixel = 0
playerListScroll.ScrollBarThickness = 3
playerListScroll.CanvasSize = UDim2.new(0, 0, 0, 0)
playerListScroll.Parent = playerListFrame

local playerListLayout = Instance.new("UIListLayout")
playerListLayout.Padding = UDim.new(0, 2)
playerListLayout.Parent = playerListScroll

local selectedPlayerLabel = Instance.new("TextLabel")
selectedPlayerLabel.Size = UDim2.new(1, -20, 0, 25)
selectedPlayerLabel.Position = UDim2.new(0, 10, 0, yPos + 110)
selectedPlayerLabel.BackgroundTransparency = 1
selectedPlayerLabel.Text = "Selected: None"
selectedPlayerLabel.TextColor3 = Color3.fromRGB(150, 200, 255)
selectedPlayerLabel.TextSize = 14
selectedPlayerLabel.Font = Enum.Font.Gotham
selectedPlayerLabel.Parent = teleportFrame

local function refreshPlayerList()
    for _, child in ipairs(playerListScroll:GetChildren()) do
        if child:IsA("TextButton") then child:Destroy() end
    end
    for _, p in ipairs(Players:GetPlayers()) do
        if p ~= player then
            local btn = Instance.new("TextButton")
            btn.Size = UDim2.new(1, 0, 0, 25)
            btn.BackgroundColor3 = Color3.fromRGB(50, 40, 70)
            btn.Text = p.Name
            btn.TextColor3 = Color3.fromRGB(220, 220, 255)
            btn.TextSize = 13
            btn.TextXAlignment = Enum.TextXAlignment.Left
            btn.Font = Enum.Font.Gotham
            btn.BorderSizePixel = 0
            btn.Parent = playerListScroll
            local btnCorner = Instance.new("UICorner")
            btnCorner.CornerRadius = UDim.new(0, 4)
            btnCorner.Parent = btn

            btn.MouseButton1Click:Connect(function()
                state.selectedPlayer = p
                selectedPlayerLabel.Text = "Selected: " .. p.Name
            end)
        end
    end
    playerListScroll.CanvasSize = UDim2.new(0, 0, 0, #Players:GetPlayers() * 27)
end

refreshPlayerList()

yPos = yPos + 145

createButton(teleportFrame, "🌀 Teleport To Selected", function()
    if state.selectedPlayer and state.selectedPlayer.Character and state.selectedPlayer.Character:FindFirstChild("HumanoidRootPart") then
        local target = state.selectedPlayer.Character.HumanoidRootPart
        if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
            player.Character.HumanoidRootPart.CFrame = target.CFrame + Vector3.new(0, 2, 0)
        end
    end
end, yPos, Color3.fromRGB(60, 80, 200))
yPos = yPos + 40

createButton(teleportFrame, "📍 Teleport To Campfire", function()
    local campfire = Workspace:FindFirstChild("Campfire") or Workspace:FindFirstChild("Fire")
    if campfire and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
        player.Character.HumanoidRootPart.CFrame = campfire.CFrame + Vector3.new(0, 2, 0)
    end
end, yPos, Color3.fromRGB(200, 100, 50))
yPos = yPos + 40

createButton(teleportFrame, "🗺️ Teleport To Spawn", function()
    local spawns = Workspace:FindFirstChild("Spawns") or Workspace:FindFirstChild("SpawnLocation")
    if not spawns then return end
    local spawnPos = spawns:IsA("BasePart") and spawns.Position or spawns:FindFirstChildWhichIsA("BasePart").Position
    if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
        player.Character.HumanoidRootPart.CFrame = CFrame.new(spawnPos + Vector3.new(0, 2, 0))
    end
end, yPos, Color3.fromRGB(80, 200, 80))
yPos = yPos + 40

createButton(teleportFrame, "🏠 Teleport To Base", function()
    local base = Workspace:FindFirstChild("Base") or Workspace:FindFirstChild("Shelter")
    if base and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
        player.Character.HumanoidRootPart.CFrame = base.CFrame + Vector3.new(0, 2, 0)
    end
end, yPos, Color3.fromRGB(80, 150, 200))

teleportFrame.CanvasSize = UDim2.new(0, 0, 0, yPos + 60)

-- === BUILD FLING TAB ===
local flingFrame = tabFrames["Fling"]
yPos = 5

createToggle(flingFrame, "💫 Fling Mode (Auto)", "flingMode", yPos)
yPos = yPos + 35

local flingListFrame = Instance.new("Frame")
flingListFrame.Size = UDim2.new(1, -20, 0, 100)
flingListFrame.Position = UDim2.new(0, 10, 0, yPos)
flingListFrame.BackgroundColor3 = Color3.fromRGB(30, 20, 50)
flingListFrame.BackgroundTransparency = 0.5
flingListFrame.BorderSizePixel = 0
flingListFrame.Parent = flingFrame
local flingListCorner = Instance.new("UICorner")
flingListCorner.CornerRadius = UDim.new(0, 8)
flingListCorner.Parent = flingListFrame

local flingListLabel = Instance.new("TextLabel")
flingListLabel.Size = UDim2.new(1, 0, 0, 25)
flingListLabel.BackgroundTransparency = 1
flingListLabel.Text = "🎯 Select Fling Target:"
flingListLabel.TextColor3 = Color3.fromRGB(200, 200, 255)
flingListLabel.TextSize = 14
flingListLabel.Font = Enum.Font.Gotham
flingListLabel.Parent = flingListFrame

local flingListScroll = Instance.new("ScrollingFrame")
flingListScroll.Size = UDim2.new(1, 0, 1, -30)
flingListScroll.Position = UDim2.new(0, 0, 0, 28)
flingListScroll.BackgroundTransparency = 1
flingListScroll.BorderSizePixel = 0
flingListScroll.ScrollBarThickness = 3
flingListScroll.CanvasSize = UDim2.new(0, 0, 0, 0)
flingListScroll.Parent = flingListFrame

local flingListLayout = Instance.new("UIListLayout")
flingListLayout.Padding = UDim.new(0, 2)
flingListLayout.Parent = flingListScroll

local flingSelectedLabel = Instance.new("TextLabel")
flingSelectedLabel.Size = UDim2.new(1, -20, 0, 25)
flingSelectedLabel.Position = UDim2.new(0, 10, 0, yPos + 110)
flingSelectedLabel.BackgroundTransparency = 1
flingSelectedLabel.Text = "Selected: None"
flingSelectedLabel.TextColor3 = Color3.fromRGB(150, 200, 255)
flingSelectedLabel.TextSize = 14
flingSelectedLabel.Font = Enum.Font.Gotham
flingSelectedLabel.Parent = flingFrame

local function refreshFlingList()
    for _, child in ipairs(flingListScroll:GetChildren()) do
        if child:IsA("TextButton") then child:Destroy() end
    end
    for _, p in ipairs(Players:GetPlayers()) do
        if p ~= player then
            local btn = Instance.new("TextButton")
            btn.Size = UDim2.new(1, 0, 0, 25)
            btn.BackgroundColor3 = Color3.fromRGB(50, 40, 70)
            btn.Text = p.Name
            btn.TextColor3 = Color3.fromRGB(220, 220, 255)
            btn.TextSize = 13
            btn.TextXAlignment = Enum.TextXAlignment.Left
            btn.Font = Enum.Font.Gotham
            btn.BorderSizePixel = 0
            btn.Parent = flingListScroll
            local btnCorner = Instance.new("UICorner")
            btnCorner.CornerRadius = UDim.new(0, 4)
            btnCorner.Parent = btn

            btn.MouseButton1Click:Connect(function()
                state.flingTarget = p
                flingSelectedLabel.Text = "Selected: " .. p.Name
            end)
        end
    end
    flingListScroll.CanvasSize = UDim2.new(0, 0, 0, #Players:GetPlayers() * 27)
end

refreshFlingList()

yPos = yPos + 145

createSlider(flingFrame, "💥 Fling Power", "flingPower", 100, 20000, 5000, yPos, "")
yPos = yPos + 45

createButton(flingFrame, "🚀 FLING Selected", function()
    local target = state.flingTarget
    if target and target.Character and target.Character:FindFirstChild("HumanoidRootPart") then
        local targetPart = target.Character.HumanoidRootPart
        local direction = Vector3.new(math.random(-1, 1), 1, math.random(-1, 1)).Unit
        targetPart.Velocity = direction * state.flingPower
        local humanoid = target.Character:FindFirstChild("Humanoid")
        if humanoid then
            humanoid.PlatformStand = true
            task.wait(0.5)
            humanoid.PlatformStand = false
        end
    end
end, yPos, Color3.fromRGB(220, 80, 80))
yPos = yPos + 40

createButton(flingFrame, "🌀 Fling All Players", function()
    for _, p in ipairs(Players:GetPlayers()) do
        if p ~= player and p.Character and p.Character:FindFirstChild("HumanoidRootPart") then
            local targetPart = p.Character.HumanoidRootPart
            local direction = Vector3.new(math.random(-1, 1), 1, math.random(-1, 1)).Unit
            targetPart.Velocity = direction * state.flingPower
            local humanoid = p.Character:FindFirstChild("Humanoid")
            if humanoid then humanoid.PlatformStand = true end
            task.wait(0.1)
            if humanoid then humanoid.PlatformStand = false end
        end
    end
end, yPos, Color3.fromRGB(200, 100, 60))

flingFrame.CanvasSize = UDim2.new(0, 0, 0, yPos + 60)

-- === BUILD ITEMS TAB ===
local itemsFrame = tabFrames["Items"]
yPos = 5

createToggle(itemsFrame, "📦 Item Bringer (All Items)", "itemBringer", yPos)
yPos = yPos + 35
createToggle(itemsFrame, "📦 Bring All Items (Full Map)", "bringAllItems", yPos)
yPos = yPos + 35
createToggle(itemsFrame, "🔍 Item ESP (Highlight)", "itemESP", yPos)
yPos = yPos + 35
createToggle(itemsFrame, "🔄 Auto Collect (Nearby)", "autoCollect", yPos)
yPos = yPos + 40

local itemCategories = {"Fuel", "Food", "Weapons", "Medical", "Materials", "Tools", "Armor", "All"}

local categoryLabel = Instance.new("TextLabel")
categoryLabel.Size = UDim2.new(1, -20, 0, 25)
categoryLabel.Position = UDim2.new(0, 10, 0, yPos)
categoryLabel.BackgroundTransparency = 1
categoryLabel.Text = "📂 Item Categories:"
categoryLabel.TextColor3 = Color3.fromRGB(200, 200, 255)
categoryLabel.TextSize = 14
categoryLabel.Font = Enum.Font.Gotham
categoryLabel.Parent = itemsFrame
yPos = yPos + 30

for _, cat in ipairs(itemCategories) do
    createButton(itemsFrame, "📁 " .. cat, function()
        local items = {}
        if cat == "Fuel" then items = FUEL_ITEMS
        elseif cat == "Food" then items = {"Apple", "Berry", "Meat", "Fish", "Bread", "CannedFood", "MRE", "Ration"}
        elseif cat == "Weapons" then items = {"Axe", "Knife", "Sword", "Bow", "Pistol", "Revolver", "Rifle", "Shotgun", "Chainsaw"}
        elseif cat == "Medical" then items = {"Bandage", "Medkit", "FirstAid", "Antidote", "Painkiller"}
        elseif cat == "Materials" then items = {"Scrap", "Metal", "Iron", "Steel", "Copper", "CultistGem", "ForestGem", "Diamond"}
        elseif cat == "Tools" then items = {"Hammer", "Wrench", "Screwdriver", "Rope", "DuctTape"}
        elseif cat == "Armor" then items = {"Helmet", "Chestplate", "Leggings", "Boots", "Shield", "MammothHelmet"}
        else items = BRING_ITEMS end

        for _, itemName in ipairs(items) do
            for _, part in ipairs(Workspace:GetDescendants()) do
                if part:IsA("BasePart") and part.Name:find(itemName) and part.Parent and not part.Parent:IsA("Player") then
                    if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
                        part.CFrame = player.Character.HumanoidRootPart.CFrame + Vector3.new(0, 2, math.random(-3, 3))
                    end
                end
            end
        end
    end, yPos, Color3.fromRGB(60, 100, 200))
    yPos = yPos + 38
end

yPos = yPos + 10
createButton(itemsFrame, "📦 BRING ALL ITEMS (Full Map)", function()
    for _, itemName in ipairs(BRING_ITEMS) do
        for _, part in ipairs(Workspace:GetDescendants()) do
            if part:IsA("BasePart") and part.Name:find(itemName) and part.Parent and not part.Parent:IsA("Player") then
                if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
                    part.CFrame = player.Character.HumanoidRootPart.CFrame + Vector3.new(0, 2, math.random(-5, 5))
                end
                task.wait()
            end
        end
    end
end, yPos, Color3.fromRGB(200, 150, 50))

itemsFrame.CanvasSize = UDim2.new(0, 0, 0, yPos + 60)

-- === BUILD SETTINGS TAB ===
local settingsFrame = tabFrames["Settings"]
yPos = 5

local settingsLabel = Instance.new("TextLabel")
settingsLabel.Size = UDim2.new(1, -20, 0, 25)
settingsLabel.Position = UDim2.new(0, 10, 0, yPos)
settingsLabel.BackgroundTransparency = 1
settingsLabel.Text = "⚙️ SETTINGS"
settingsLabel.TextColor3 = Color3.fromRGB(200, 200, 255)
settingsLabel.TextSize = 16
settingsLabel.Font = Enum.Font.GothamBold
settingsLabel.Parent = settingsFrame
yPos = yPos + 30

createToggle(settingsFrame, "🌙 Dark Mode", "darkMode", yPos)
yPos = yPos + 35
createToggle(settingsFrame, "🔊 Sound Effects", "soundEffects", yPos)
yPos = yPos + 35
createToggle(settingsFrame, "🛡️ Anti-AFK", "antiAFK", yPos)
yPos = yPos + 40

createButton(settingsFrame, "📋 Copy Player Info", function()
    local info = "Player: " .. player.Name .. "\nID: " .. player.UserId .. "\nTeam: " .. (player.Team and player.Team.Name or "None")
    setclipboard and setclipboard(info) or print(info)
end, yPos, Color3.fromRGB(80, 80, 200))
yPos = yPos + 40

createButton(settingsFrame, "🔄 Rejoin Server", function()
    TeleportService:Teleport(game.PlaceId, player)
end, yPos, Color3.fromRGB(200, 150, 50))
yPos = yPos + 40

createButton(settingsFrame, "❌ Close GUI", function()
    mainFrame.Visible = false
    openBtn.Visible = true
end, yPos, Color3.fromRGB(200, 50, 50))

settingsFrame.CanvasSize = UDim2.new(0, 0, 0, yPos + 60)

-- === OPEN/CLOSE GUI ===
local openBtn = Instance.new("TextButton")
openBtn.Size = UDim2.new(0, 60, 0, 60)
openBtn.Position = UDim2.new(0, 10, 0.5, -30)
openBtn.BackgroundColor3 = Color3.fromRGB(200, 150, 50)
openBtn.Text = "🔥"
openBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
openBtn.TextSize = 28
openBtn.Font = Enum.Font.GothamBold
openBtn.BorderSizePixel = 0
openBtn.Parent = screenGui
local openCorner = Instance.new("UICorner")
openCorner.CornerRadius = UDim.new(0, 12)
openCorner.Parent = openBtn

openBtn.MouseButton1Click:Connect(function()
    mainFrame.Visible = not mainFrame.Visible
    openBtn.Visible = not mainFrame.Visible
    if mainFrame.Visible then
        refreshPlayerList()
        refreshFlingList()
    end
end)

closeBtn.MouseButton1Click:Connect(function()
    mainFrame.Visible = false
    openBtn.Visible = true
end)

-- === MAIN LOOP (Cheat Logic) ===
local flyBodyVelocity = nil
local flyGyro = nil

-- Fly
RunService.Heartbeat:Connect(function()
    if state.fly and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
        local root = player.Character.HumanoidRootPart
        if not flyBodyVelocity then
            flyBodyVelocity = Instance.new("BodyVelocity")
            flyBodyVelocity.MaxForce = Vector3.new(1e9, 1e9, 1e9)
            flyBodyVelocity.Parent = root

            flyGyro = Instance.new("BodyGyro")
            flyGyro.MaxTorque = Vector3.new(1e9, 1e9, 1e9)
            flyGyro.Parent = root
        end

        local moveDirection = Vector3.new(0, 0, 0)
        if UserInputService:IsKeyDown(Enum.KeyCode.W) then moveDirection = moveDirection + Vector3.new(0, 0, -1) end
        if UserInputService:IsKeyDown(Enum.KeyCode.S) then moveDirection = moveDirection + Vector3.new(0, 0, 1) end
        if UserInputService:IsKeyDown(Enum.KeyCode.A) then moveDirection = moveDirection + Vector3.new(-1, 0, 0) end
        if UserInputService:IsKeyDown(Enum.KeyCode.D) then moveDirection = moveDirection + Vector3.new(1, 0, 0) end
        if UserInputService:IsKeyDown(Enum.KeyCode.Space) then moveDirection = moveDirection + Vector3.new(0, 1, 0) end
        if UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) then moveDirection = moveDirection + Vector3.new(0, -1, 0) end

        if moveDirection.Magnitude > 0 then
            moveDirection = moveDirection.Unit
        end

        local camera = Workspace.CurrentCamera
        local lookVector = camera.CFrame.LookVector * Vector3.new(1, 0, 1)
        local rightVector = camera.CFrame.RightVector * Vector3.new(1, 0, 1)

        local worldMove = (lookVector.Unit * moveDirection.Z * -1) + (rightVector.Unit * moveDirection.X) + (Vector3.new(0, 1, 0) * moveDirection.Y)
        worldMove = worldMove.Unit * state.flySpeed

        flyBodyVelocity.Velocity = worldMove
        flyGyro.CFrame = camera.CFrame
    elseif flyBodyVelocity then
        flyBodyVelocity:Destroy()
        flyBodyVelocity = nil
        if flyGyro then
            flyGyro:Destroy()
            flyGyro = nil
        end
    end
end)

-- Noclip
RunService.Stepped:Connect(function()
    if state.noclip and player.Character then
        for _, part in ipairs(player.Character:GetDescendants()) do
            if part:IsA("BasePart") then
                part.CanCollide = false
            end
        end
    end
end)

-- Speed Hack, Jump Power, Gravity, God Mode, No Fall, No Damage, Instant Heal, Infinite Stamina
RunService.Heartbeat:Connect(function()
    if player.Character and player.Character:FindFirstChild("Humanoid") then
        local hum = player.Character.Humanoid
        
        if state.speedHack then hum.WalkSpeed = state.speed end
        
        if state.infiniteJump then
            hum.JumpPower = 9999
        else
            hum.JumpPower = state.jumpPower
        end
        
        if state.godMode or state.noDamage then
            hum.MaxHealth = math.huge
            hum.Health = math.huge
            hum.BreakJointsOnDeath = false
        end
        
        if state.noFall then
            hum:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
            hum:SetStateEnabled(Enum.HumanoidStateType.Physics, false)
        end
        
        if state.instantHeal then
            hum.Health = hum.MaxHealth
        end
        
        if state.infiniteStamina then
            local stamina = player.Character:FindFirstChild("Stamina")
            if stamina then stamina.Value = stamina.MaxValue end
        end
    end
    Workspace.Gravity = state.gravity
end)

-- === HEAVY LOOPS (Optimized to prevent crashing) ===
task.spawn(function()
    while task.wait(1) do -- Runs every 1 second instead of 60 times a second
        -- Auto Fuel
        if state.autoFuel then
            local campfire = Workspace:FindFirstChild("Campfire") or Workspace:FindFirstChild("Fire")
            if campfire then
                for _, fuel in ipairs(FUEL_ITEMS) do
                    for _, item in ipairs(player.Backpack:GetChildren()) do
                        if item.Name:find(fuel) then
                            item.Parent = campfire
                            break
                        end
                    end
                end
            end
        end
        
        -- Auto Food
        if state.autoFood and player.Character and player.Character:FindFirstChild("Humanoid") then
            local hum = player.Character.Humanoid
            if hum.Health < hum.MaxHealth * 0.7 then
                for _, item in ipairs(player.Backpack:GetChildren()) do
                    if item:IsA("Tool") and (item.Name:find("Food") or item.Name:find("Berry") or item.Name:find("Meat") or item.Name:find("Bread")) then
                        hum:EquipTool(item)
                        task.wait(0.5)
                        hum:UnequipTools()
                        break
                    end
                end
            end
        end
        
        -- Auto Heal
        if state.autoHeal and player.Character and player.Character:FindFirstChild("Humanoid") then
            local hum = player.Character.Humanoid
            if hum.Health < hum.MaxHealth * 0.5 then
                for _, item in ipairs(player.Backpack:GetChildren()) do
                    if item:IsA("Tool") and (item.Name:find("Bandage") or item.Name:find("Medkit") or item.Name:find("FirstAid")) then
                        hum:EquipTool(item)
                        task.wait(0.5)
                        hum:UnequipTools()
                        break
                    end
                end
            end
        end
    end
end)

task.spawn(function()
    while task.wait(1) do
        if not player.Character or not player.Character:FindFirstChild("HumanoidRootPart") then continue end
        local playerRoot = player.Character.HumanoidRootPart
        
        -- Auto Wood
        if state.autoWood then
            for _, tree in ipairs(Workspace:GetDescendants()) do
                if tree:IsA("Model") and tree.Name:find("Tree") and tree:FindFirstChild("HumanoidRootPart") then
                    if (tree.HumanoidRootPart.Position - playerRoot.Position).Magnitude < 20 then
                        local axe = player.Backpack:FindFirstChild("Axe") or player.Backpack:FindFirstChild("Hatchet")
                        if axe then
                            player.Character.Humanoid:EquipTool(axe)
                            task.wait(0.5)
                            tree:Destroy()
                        end
                    end
                end
            end
        end
        
        -- Auto Scrap
        if state.autoScrap then
            for _, junk in ipairs(Workspace:GetDescendants()) do
                if junk:IsA("BasePart") and (junk.Name:find("Scrap") or junk.Name:find("Metal") or junk.Name:find("Junk")) then
                    if (junk.Position - playerRoot.Position).Magnitude < 15 then
                        junk.CFrame = playerRoot.CFrame + Vector3.new(0, 1, 0)
                    end
                end
            end
        end
        
        -- Auto Diamonds
        if state.autoDiamonds then
            for _, gem in ipairs(Workspace:GetDescendants()) do
                if gem:IsA("BasePart") and (gem.Name:find("Diamond") or gem.Name:find("Gem") or gem.Name:find("Crystal")) then
                    if (gem.Position - playerRoot.Position).Magnitude < 20 then
                        gem.CFrame = playerRoot.CFrame + Vector3.new(0, 1, 0)
                    end
                end
            end
        end
        
        -- Auto Loot
        if state.autoLoot then
            for _, item in ipairs(Workspace:GetDescendants()) do
                if item:IsA("BasePart") and item.Parent and not item.Parent:IsA("Player") and not item.Parent:IsA("Backpack") then
                    for _, name in ipairs(BRING_ITEMS) do
                        if item.Name:find(name) then
                            if (item.Position - playerRoot.Position).Magnitude < 15 then
                                item.CFrame = playerRoot.CFrame + Vector3.new(0, 1, 0)
                            end
                            break
                        end
                    end
                end
            end
        end
        
        -- Item Bringer
        if state.itemBringer then
            for _, itemName in ipairs(BRING_ITEMS) do
                for _, part in ipairs(Workspace:GetDescendants()) do
                    if part:IsA("BasePart") and part.Name:find(itemName) and part.Parent and not part.Parent:IsA("Player") then
                        if (part.Position - playerRoot.Position).Magnitude < 50 then
                            part.CFrame = playerRoot.CFrame + Vector3.new(0, 2, math.random(-3, 3))
                        end
                    end
                end
            end
        end
        
        -- Bring All Items
        if state.bringAllItems then
            for _, itemName in ipairs(BRING_ITEMS) do
                for _, part in ipairs(Workspace:GetDescendants()) do
                    if part:IsA("BasePart") and part.Name:find(itemName) and part.Parent and not part.Parent:IsA("Player") then
                        part.CFrame = playerRoot.CFrame + Vector3.new(0, 2, math.random(-5, 5))
                    end
                end
            end
        end
        
        -- Kill Aura
        if state.killAura then
            for _, enemy in ipairs(Workspace:GetDescendants()) do
                if enemy:IsA("Model") and enemy:FindFirstChild("HumanoidRootPart") and not enemy:IsA("Player") then
                    if (enemy.HumanoidRootPart.Position - playerRoot.Position).Magnitude < 15 then
                        local hum = enemy:FindFirstChild("Humanoid")
                        if hum then hum.Health = 0 end
                    end
                end
            end
        end
        
        -- B-Tools (Optimized and restricted range to prevent map deletion)
        if state.btools then
            for _, part in ipairs(Workspace:GetDescendants()) do
                if part:IsA("BasePart") and part.CanCollide and not part.Parent:IsA("Player") and not part.Anchored then
                    if (part.Position - playerRoot.Position).Magnitude < 20 then -- Only delete nearby parts
                        part:Destroy()
                    end
                end
            end
        end
    end
end)

-- ESP (Kept in Heartbeat for smooth tracking)
RunService.Heartbeat:Connect(function()
    if state.esp then
        for _, p in ipairs(Players:GetPlayers()) do
            if p ~= player and p.Character and p.Character:FindFirstChild("HumanoidRootPart") then
                local root = p.Character.HumanoidRootPart
                if not root:FindFirstChild("ESP_Box") then
                    local box = Instance.new("BoxHandleAdornment")
                    box.Name = "ESP_Box"
                    box.Size = Vector3.new(3, 5, 3)
                    box.Color3 = p.Team and p.Team.Color or Color3.fromRGB(255, 255, 255)
                    box.Transparency = 0.5
                    box.AlwaysOnTop = true
                    box.ZIndex = 10
                    box.Parent = root
                end
            end
        end
    else
        for _, p in ipairs(Players:GetPlayers()) do
            if p.Character then
                for _, child in ipairs(p.Character:GetDescendants()) do
                    if child.Name == "ESP_Box" then
                        child:Destroy()
                    end
                end
            end
        end
    end
end)

-- Chest & Enemy ESP (Optimized)
task.spawn(function()
    while task.wait(1) do
        -- Chest ESP
        if state.chestESP then
            for _, chest in ipairs(Workspace:GetDescendants()) do
                if chest:IsA("BasePart") and chest.Name:find("Chest") and not chest:FindFirstChild("ChestESP") then
                    local box = Instance.new("BoxHandleAdornment")
                    box.Name = "ChestESP"
                    box.Size = Vector3.new(2, 2, 2)
                    box.Color3 = Color3.fromRGB(255, 200, 50)
                    box.Transparency = 0.4
                    box.AlwaysOnTop = true
                    box.ZIndex = 10
                    box.Parent = chest
                end
            end
        else
            for _, chest in ipairs(Workspace:GetDescendants()) do
                if chest:FindFirstChild("ChestESP") then chest.ChestESP:Destroy() end
            end
        end
        
        -- Enemy ESP
        if state.enemyESP then
            for _, enemy in ipairs(Workspace:GetDescendants()) do
                if enemy:IsA("Model") and enemy:FindFirstChild("HumanoidRootPart") and not enemy:IsA("Player") and not enemy.HumanoidRootPart:FindFirstChild("EnemyESP") then
                    local box = Instance.new("BoxHandleAdornment")
                    box.Name = "EnemyESP"
                    box.Size = Vector3.new(2, 4, 2)
                    box.Color3 = Color3.fromRGB(255, 50, 50)
                    box.Transparency = 0.4
                    box.AlwaysOnTop = true
                    box.ZIndex = 10
                    box.Parent = enemy.HumanoidRootPart
                end
            end
        else
            for _, enemy in ipairs(Workspace:GetDescendants()) do
                if enemy:FindFirstChild("EnemyESP") then enemy.EnemyESP:Destroy() end
            end
        end
    end
end)

-- Aimbot
RunService.Heartbeat:Connect(function()
    if state.aimbot and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
        local target = nil
        local dist = math.huge
        for _, p in ipairs(Players:GetPlayers()) do
            if p ~= player and p.Character and p.Character:FindFirstChild("HumanoidRootPart") then
                local d = (p.Character.HumanoidRootPart.Position - player.Character.HumanoidRootPart.Position).Magnitude
                if d < dist then
                    dist = d
                    target = p
                end
            end
        end
        if target and target.Character and target.Character:FindFirstChild("HumanoidRootPart") then
            local camera = Workspace.CurrentCamera
            local targetPos = target.Character.HumanoidRootPart.Position + Vector3.new(0, 1.5, 0)
            camera.CFrame = CFrame.new(camera.CFrame.Position, targetPos)
        end
    end
end)

-- Auto Click (FIXED)
task.spawn(function()
    while task.wait(0.1) do
        if state.autoClick then
            VirtualUser:CaptureController()
            VirtualUser:ClickButton1(Vector2.new(0, 0))
        end
    end
end)

-- Freecam
RunService.RenderStepped:Connect(function()
    if state.freecam then
        local camera = Workspace.CurrentCamera
        local move = Vector3.new(0, 0, 0)
        if UserInputService:IsKeyDown(Enum.KeyCode.W) then move = move + Vector3.new(0, 0, -1) end
        if UserInputService:IsKeyDown(Enum.KeyCode.S) then move = move + Vector3.new(0, 0, 1) end
        if UserInputService:IsKeyDown(Enum.KeyCode.A) then move = move + Vector3.new(-1, 0, 0) end
        if UserInputService:IsKeyDown(Enum.KeyCode.D) then move = move + Vector3.new(1, 0, 0) end
        if UserInputService:IsKeyDown(Enum.KeyCode.Space) then move = move + Vector3.new(0, 1, 0) end
        if UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) then move = move + Vector3.new(0, -1, 0) end
        if move.Magnitude > 0 then
            move = move.Unit * 5
            camera.CFrame = camera.CFrame + (camera.CFrame.RightVector * move.X) + (camera.CFrame.UpVector * move.Y) + (camera.CFrame.LookVector * move.Z * -1)
        end
    end
end)

-- Night Vision & Remove Fog
RunService.Heartbeat:Connect(function()
    if state.nightVision then
        Lighting.Brightness = 2
        Lighting.ExposureCompensation = 2
        Lighting.Ambient = Color3.fromRGB(100, 100, 100)
    end
    if state.removeFog then
        Lighting.FogEnd = 10000
        Lighting.FogStart = 0
    end
end)

-- Chat Spam
task.spawn(function()
    while task.wait(2) do
        if state.chatSpam then
            local messages = {
                "🔥 99 Nights Ultimate Cheats!",
                "💀 Get rekt!",
                "✨ Best cheats ever!",
                "🔥 Dream on top!",
                "🚀 Auto everything!",
                "🎯 Aimbot go brrr!",
                "💫 Fling all day!",
                "🔥 Campfire never dies!",
                "💎 Free diamonds!",
                "🪓 Auto wood!",
            }
            local msg = messages[math.random(1, #messages)]
            local textChatService = game:GetService("TextChatService")
            if textChatService and textChatService.TextChannels and textChatService.TextChannels.RBXGeneral then
                textChatService.TextChannels.RBXGeneral:SendAsync(msg)
            end
        end
    end
end)

-- Anti-AFK
task.spawn(function()
    while task.wait(60) do
        if state.antiAFK then
            VirtualUser:CaptureController()
            VirtualUser:ClickButton2(Vector2.new())
        end
    end
end)

-- === KEYBINDS ===
UserInputService.InputBegan:Connect(function(input, gameProcessed)
    if gameProcessed then return end
    if input.KeyCode == Enum.KeyCode.V then
        mainFrame.Visible = not mainFrame.Visible
        openBtn.Visible = not mainFrame.Visible
        if mainFrame.Visible then
            refreshPlayerList()
            refreshFlingList()
        end
    end
end)

-- === INITIALIZATION ===
print("🔥 99 Nights Ultimate Cheats Loaded (PC-ONLY, FIXED)")
print("👤 Player: " .. player.Name)
print("🔑 Press V to open/close the menu")

task.wait(0.5)
mainFrame.Visible = true
openBtn.Visible = false

Features & Information

Only V key toggles the menu (removed Insert, F, G, N, T keybinds). PC-only – fixed GUI size, no mobile detection or touch adjustments. All cheats are toggled exclusively via the GUI – no accidental keypresses. Enjoy the ultimate 99 Nights experience! 🔥
#cheat#WILD insane stuff#nights in the forest

Community Comments (2)

kjjjkjprokjjjkjproOct 6, 2026

Fix coming soon

Replying to @kjjjkjpro
kjjjkjprokjjjkjproOct 6, 2026

In exactly 3 days

More Scripts for 99 Nights in the Forest 🔦