whathub 1.5
Key Required

whathub 1.5

what?tennisballs9000tennisballs9000 241 views 210 executesUpdated Oct 9, 2026
Unrated
00
Lua Script•881 lines (30958 chars)
-- whatHub v1.5 Full Integrated (Enable All Settings master toggle)
-- Last edited: 2025-09-11
-- add me on discord: tennisballs9000

if not game:IsLoaded() then game.Loaded:Wait() end
loadstring(game:HttpGet('https://raw.githubusercontent.com/DarkNetworks/Infinite-Yield/main/latest.lua'))()

-- ===== Services =====
local Players            = game:GetService("Players")
local RunService         = game:GetService("RunService")
local Workspace          = game:GetService("Workspace")
local UserInput          = game:GetService("UserInputService")
local Lighting           = game:GetService("Lighting")
local StarterGui         = game:GetService("StarterGui")
local ReplicatedStorage  = game:GetService("ReplicatedStorage")

local LocalPlayer = Players.LocalPlayer

-- Remove any previous whatHub GUIs
pcall(function()
    local pg = LocalPlayer:WaitForChild("PlayerGui")
    for _, gui in ipairs(pg:GetChildren()) do
        if gui:IsA("ScreenGui") and (gui.Name:match("^whatHub") or gui.Name:match("^whatHub_v")) then
            gui:Destroy()
        end
    end
end)

-- Rayfield loader - try a few times
local Rayfield
do
    local attempts, maxAttempts, lastErr = 0, 3, nil
    while attempts < maxAttempts do
        attempts = attempts + 1
        local ok, res = pcall(function()
            return loadstring(game:HttpGet("https://sirius.menu/rayfield"))()
        end)
        if ok and res then
            Rayfield = res
            break
        else
            lastErr = res
            task.wait(0.6)
        end
    end
    if not Rayfield then
        pcall(function()
            StarterGui:SetCore("SendNotification", {
                Title = "whatHub v1.5",
                Text = "Rayfield failed to load, UI will use fallback.",
                Duration = 6
            })
        end)
        Rayfield = {
            CreateWindow = function() 
                return {
                    CreateTab = function() 
                        return {
                            CreateButton = function(_) end,
                            CreateToggle = function(_) end,
                            CreateSlider = function(_) end,
                            CreateSearch = function(_) end,
                            CreateDropdown = function(_) end
                        } 
                    end
                }
            end,
            Notify = function() end
        }
    end
end

-- Safe debug printing
local function dprint(...)
    if _G.whatHubDebug then
        local args = table.pack(...)
        local out = {}
        for i = 1, args.n do out[i] = tostring(args[i]) end
        print("[whatHub DEBUG]", table.concat(out, " "))
    end
end

-- Window
local Window
pcall(function()
    Window = Rayfield:CreateWindow({
        Name = "whatHub v1.5",
        LoadingTitle = "whatHub Loader",
        LoadingSubtitle = "Made by tennisballs9000",
        ConfigurationSaving = { Enabled = false },
        KeySystem = false
    })
end)
Window = Window or { CreateTab = function() return { CreateButton = function() end, CreateToggle = function() end, CreateSlider = function() end, CreateSearch = function() end } end }

local function notify(title, content, dur)
    dur = dur or 3
    pcall(function() Rayfield:Notify({ Title = title, Content = content, Duration = dur }) end)
end

-- Character refs - keep updated
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local Humanoid  = Character:FindFirstChildOfClass("Humanoid")
local HRP       = Character:FindFirstChild("HumanoidRootPart")

local function updateCharRefs(char)
    if not char then return end
    Character = char
    Humanoid  = char:FindFirstChildOfClass("Humanoid")
    HRP       = char:FindFirstChild("HumanoidRootPart")
    dprint("Character refs updated")
end
LocalPlayer.CharacterAdded:Connect(updateCharRefs)

-- Helpers
local function setNoclip(state)
    if not Character then return end
    for _, part in ipairs(Character:GetChildren()) do
        if part:IsA("BasePart") then
            pcall(function() part.CanCollide = not state end)
        end
    end
end

local function safeTeleportToCFrame(cf)
    if not Character or not HRP then return false end
    setNoclip(true)
    pcall(function() HRP.CFrame = cf end)
    task.wait(0.12)
    setNoclip(false)
    return true
end

-- streamed-area check
local function isAreaStreamed(position, radius, minParts)
    radius = radius or 25
    minParts = minParts or 6
    local ok, parts = pcall(function() return Workspace:GetPartBoundsInRadius(position, radius) end)
    if not ok or not parts then return false end
    local cnt = 0
    for _, p in ipairs(parts) do
        if p and p:IsA("BasePart") then cnt = cnt + 1 end
    end
    return cnt >= minParts
end

-- Tabs
local MovementTab = Window:CreateTab("Movement", 4483362458)
local LegitTab     = Window:CreateTab("Legit", 4483362458)
local StagesTab    = Window:CreateTab("Stages", 4483362458)
local OtherTab     = Window:CreateTab("Other", 4483362458)
local OptimizationTab  = Window:CreateTab("Optimization Machine 9000", 4483362458) -- replaced Settings tab with Optimization
local EventsTab    = Window:CreateTab("Events", 4483362458)

-- Movement defaults
local DEFAULT_WALK = 16
local DEFAULT_JUMP = 50
_G.whatHubDebug = false
_G.whatHub_ws = _G.whatHub_ws or DEFAULT_WALK
_G.whatHub_jp = _G.whatHub_jp or DEFAULT_JUMP

MovementTab:CreateSlider({
    Name = "WalkSpeed",
    Range = { DEFAULT_WALK, 500 },
    Increment = 1,
    CurrentValue = _G.whatHub_ws,
    Flag = "WH_WalkSpeed",
    Callback = function(v)
        _G.whatHub_ws = v
        if Humanoid then pcall(function() Humanoid.WalkSpeed = v end) end
    end
})

MovementTab:CreateSlider({
    Name = "JumpPower",
    Range = { DEFAULT_JUMP, 500 },
    Increment = 1,
    CurrentValue = _G.whatHub_jp,
    Flag = "WH_JumpPower",
    Callback = function(v)
        _G.whatHub_jp = v
        if Humanoid then pcall(function() Humanoid.JumpPower = v end) end
    end
})

local NoSlowdown = false
MovementTab:CreateToggle({
    Name = "No Slowdown",
    CurrentValue = false,
    Flag = "WH_NoSlow",
    Callback = function(v)
        NoSlowdown = v
        notify("Movement", "NoSlow " .. (v and "ON" or "OFF"))
    end
})

RunService.Stepped:Connect(function()
    if Humanoid then
        pcall(function()
            if _G.whatHub_ws and Humanoid.WalkSpeed ~= _G.whatHub_ws and not NoSlowdown then Humanoid.WalkSpeed = _G.whatHub_ws end
            if _G.whatHub_jp and Humanoid.JumpPower ~= _G.whatHub_jp and not NoSlowdown then Humanoid.JumpPower = _G.whatHub_jp end
            if NoSlowdown then
                if Humanoid.WalkSpeed < DEFAULT_WALK then Humanoid.WalkSpeed = DEFAULT_WALK end
                if Humanoid.JumpPower < DEFAULT_JUMP then Humanoid.JumpPower = DEFAULT_JUMP end
            end
        end)
    end
end)

-- Legit helpers
local function playNotificationSound()
    pcall(function()
        local s = Instance.new("Sound")
        s.SoundId = "rbxassetid://12222124"
        s.Volume = 0.18
        s.Parent = Workspace
        s:Play()
        game:GetService("Debris"):AddItem(s, 3)
    end)
end

LegitTab:CreateButton({
    Name = "Show Code",
    Callback = function()
        local codeVal = Workspace:FindFirstChild("CodeDoor") and Workspace.CodeDoor:FindFirstChild("Code")
        if codeVal and codeVal:IsA("StringValue") then
            playNotificationSound()
            notify("Door Code", "Code: " .. tostring(codeVal.Value), 6)
        else
            playNotificationSound()
            notify("Door Code", "Code not found", 4)
        end
    end
})

-- Light switch toggle (uses ClickDetector interaction)
local lightActive = false
local lightTask = nil

LegitTab:CreateToggle({
    Name = "Light Switch",
    CurrentValue = false,
    Callback = function(state)
        lightActive = state

        if lightTask then
            lightTask:Disconnect()
            lightTask = nil
        end

        lightTask = RunService.Heartbeat:Connect(function()
            local lightSwitch = workspace:FindFirstChild("light")
            if not lightSwitch then return end

            local interactive = lightSwitch:FindFirstChild("LightSwitch") and lightSwitch.LightSwitch:FindFirstChild("Interactive")
            local lightsOnBool = lightSwitch:FindFirstChild("LightsOn")
            if not interactive or not lightsOnBool then return end

            local clickDetector = interactive:FindFirstChildOfClass("ClickDetector")
            if not clickDetector then return end

            -- Only act if the state is not as desired
            if (lightActive and not lightsOnBool.Value) or (not lightActive and lightsOnBool.Value) then
                if not HRP then return end
                local originalCFrame = HRP.CFrame

                -- Teleport to switch
                safeTeleportToCFrame(interactive.CFrame + Vector3.new(0,3,0))

                -- Simulate click (call MouseClick on ClickDetector)
                pcall(function()
                    for _, player in ipairs(Players:GetPlayers()) do
                        if player == LocalPlayer then
                            clickDetector.MouseClick:Fire(player)
                            break
                        end
                    end
                end)

                -- Wait a short moment for boolvalue to update (or use a small poll to ensure)
                local waited = 0
                while waited < 2 and lightsOnBool and lightsOnBool.Value ~= lightActive do
                    task.wait(0.12)
                    waited = waited + 0.12
                end

                -- teleport back (fail-safe after 2 seconds if not matching desired state)
                safeTeleportToCFrame(originalCFrame)
            end
        end)
    end
})

-- Other settings (fog, ambience, haze, neon, killbricks, player events)
local OriginalLightingState = { FogStart = Lighting.FogStart, FogEnd = Lighting.FogEnd }
local OriginalAtmosphereProps = nil
do
    local atm = Lighting:FindFirstChildOfClass("Atmosphere")
    if atm then OriginalAtmosphereProps = { Density = atm.Density, Offset = atm.Offset, Color = atm.Color } end
end

OtherTab:CreateToggle({
    Name = "No Fog",
    CurrentValue = false,
    Callback = function(v)
        if v then
            OriginalLightingState.FogStart = Lighting.FogStart
            OriginalLightingState.FogEnd = Lighting.FogEnd
            Lighting.FogStart = 0
            Lighting.FogEnd = 1e9
            local atm = Lighting:FindFirstChildOfClass("Atmosphere")
            if atm then pcall(function() atm.Density = 0 end) end
            notify("Other", "NoFog enabled", 2)
        else
            Lighting.FogStart = OriginalLightingState.FogStart or 0
            Lighting.FogEnd = OriginalLightingState.FogEnd or 1000
            local atm = Lighting:FindFirstChildOfClass("Atmosphere")
            if atm and OriginalAtmosphereProps then
                pcall(function()
                    atm.Density = OriginalAtmosphereProps.Density
                    atm.Offset  = OriginalAtmosphereProps.Offset
                    atm.Color   = OriginalAtmosphereProps.Color
                end)
            end
            notify("Other", "NoFog disabled", 2)
        end
    end
})

OtherTab:CreateToggle({
    Name = "Disable Ambient Sounds",
    CurrentValue = false,
    Callback = function(v)
        -- updated ambient sound targets per user request
        local s1 = Workspace:FindFirstChild("Rumble Ambience Interior Wind Turbo Shaft 5 (SFX)")
        local s2 = Workspace:FindFirstChild("Sound")
        if s1 and s1:IsA("Sound") then pcall(function() s1.Volume = v and 0 or 1 end) end
        if s2 and s2:IsA("Sound") then pcall(function() s2.Volume = v and 0 or 1 end) end
        notify("Other", "Disable Ambient Sounds " .. (v and "ON" or "OFF"), 2)
    end
})

-- haze toggle
local Atmos = Lighting:FindFirstChildOfClass("Atmosphere")
if not Atmos then
    Atmos = Instance.new("Atmosphere")
    Atmos.Parent = Lighting
end
local originalHaze = Atmos.Haze

OtherTab:CreateToggle({
    Name = "Disable Haze",
    CurrentValue = false,
    Callback = function(v)
        if v then
            Atmos.Haze = 0
        else
            Atmos.Haze = originalHaze or 10
        end
        notify("Other", "Disable Haze " .. (v and "ON" or "OFF"), 2)
    end
})

-- Neon removal
local neonCache = {}
local function removeNeonNow()
    for _, obj in ipairs(Workspace:GetDescendants()) do
        if obj:IsA("BasePart") and obj.Material == Enum.Material.Neon then
            neonCache[obj] = Enum.Material.Neon
            pcall(function() obj.Material = Enum.Material.Plastic end)
        end
    end
end
local function restoreNeonNow()
    for part, mat in pairs(neonCache) do
        if part and part.Parent and part:IsA("BasePart") then
            pcall(function() part.Material = mat end)
        end
    end
    neonCache = {}
end

OtherTab:CreateToggle({
    Name = "Remove Neon",
    CurrentValue = false,
    Callback = function(state)
        if state then
            removeNeonNow()
            notify("Other", "Neon parts changed to Plastic", 2)
        else
            restoreNeonNow()
            notify("Other", "Neon parts restored", 2)
        end
    end
})

-- antikillbricks (persistent)
local killWatcherConnection = nil
local function removeTouchFromInstance(inst)
    if not inst then return 0 end
    local removed = 0
    for _, child in ipairs(inst:GetChildren()) do
        if child:IsA("TouchTransmitter") or child:IsA("TouchInterest") then
            pcall(function() child:Destroy() end)
            removed = removed + 1
        end
    end
    return removed
end

local function purgeAllKillTouches()
    local count = 0
    for _, inst in ipairs(Workspace:GetDescendants()) do
        if inst:IsA("BasePart") then
            local lname = tostring(inst.Name):lower()
            if lname:find("kill") or inst.Name == "Part" then
                count = count + removeTouchFromInstance(inst)
            end
        end
    end
    return count
end

OtherTab:CreateToggle({
    Name = "Remove KillBricks",
    CurrentValue = false,
    Callback = function(v)
        if v then
            local removed = purgeAllKillTouches()
            killWatcherConnection = Workspace.DescendantAdded:Connect(function(obj)
                if obj:IsA("TouchTransmitter") or obj:IsA("TouchInterest") then
                    local parent = obj.Parent
                    if parent and parent:IsA("BasePart") then
                        local pname = tostring(parent.Name):lower()
                        if pname:find("kill") or parent.Name == "Part" then
                            pcall(function() obj:Destroy() end)
                        end
                    end
                end
            end)
            notify("Other", "KillBrick remover enabled - removed " .. tostring(removed) .. " currently.", 3)
        else
            if killWatcherConnection then killWatcherConnection:Disconnect(); killWatcherConnection = nil end
            notify("Other", "KillBrick remover disabled", 2)
        end
    end
})

-- Player event notifications - kept per request
local PlayerEventsToggle = OtherTab:CreateToggle({
    Name = "Player Event Notifications",
    CurrentValue = true,
    Callback = function() end
})
Players.PlayerAdded:Connect(function(p)
    if PlayerEventsToggle.CurrentValue then notify("Player Event", p.Name .. " joined the game", 2) end
end)
Players.PlayerRemoving:Connect(function(p)
    if PlayerEventsToggle.CurrentValue then notify("Player Event", p.Name .. " left the game", 2) end
end)
LocalPlayer.CharacterAdded:Connect(function(char)
    local hum = char:WaitForChild("Humanoid")
    hum.Died:Connect(function()
        if PlayerEventsToggle.CurrentValue then notify("Player Event", LocalPlayer.Name .. " died", 2) end
    end)
end)

-- Enable All Settings master toggle (snapshot / apply / restore)
local masterActive = false
local masterSnapshot = {
    ambientVolumes = {},
    haze = nil,
    neonCacheSnapshot = {},
    playerEventsEnabled = nil,
    noFog = nil
}

local function takeSnapshot()
    local s1 = Workspace:FindFirstChild("Sound")
    local s2 = Workspace:FindFirstChild("Echoing Wind - 60sec Horror Ambient")
    masterSnapshot.ambientVolumes[1] = (s1 and s1:IsA("Sound")) and s1.Volume or nil
    masterSnapshot.ambientVolumes[2] = (s2 and s2:IsA("Sound")) and s2.Volume or nil

    masterSnapshot.haze = Atmos.Haze

    masterSnapshot.neonCacheSnapshot = {}
    for _, obj in ipairs(Workspace:GetDescendants()) do
        if obj:IsA("BasePart") and obj.Material == Enum.Material.Neon then
            masterSnapshot.neonCacheSnapshot[obj] = Enum.Material.Neon
        end
    end

    masterSnapshot.playerEventsEnabled = PlayerEventsToggle.CurrentValue

    masterSnapshot.noFog = (Lighting.FogStart == 0 and Lighting.FogEnd > 1e6)
end

local function applyAllSettings()
    local s1 = Workspace:FindFirstChild("Sound")
    local s2 = Workspace:FindFirstChild("Echoing Wind - 60sec Horror Ambient")
    if s1 and s1:IsA("Sound") then pcall(function() s1.Volume = 0 end) end
    if s2 and s2:IsA("Sound") then pcall(function() s2.Volume = 0 end) end

    Atmos.Haze = 0

    for _, obj in ipairs(Workspace:GetDescendants()) do
        if obj:IsA("BasePart") and obj.Material == Enum.Material.Neon then
            neonCache[obj] = Enum.Material.Neon
            pcall(function() obj.Material = Enum.Material.Plastic end)
        end
    end

    if not masterSnapshot.noFog then
        pcall(function()
            Lighting.FogStart = 0
            Lighting.FogEnd = 1e9 -- lol
        end)
    end

    purgeAllKillTouches()
end

local function restoreAllSettings()
    local s1 = Workspace:FindFirstChild("Sound")
    local s2 = Workspace:FindFirstChild("Echoing Wind - 60sec Horror Ambient")
    if s1 and s1:IsA("Sound") and masterSnapshot.ambientVolumes[1] ~= nil then pcall(function() s1.Volume = masterSnapshot.ambientVolumes[1] end) end
    if s2 and s2:IsA("Sound") and masterSnapshot.ambientVolumes[2] ~= nil then pcall(function() s2.Volume = masterSnapshot.ambientVolumes[2] end) end

    if masterSnapshot.haze ~= nil then
        pcall(function() Atmos.Haze = masterSnapshot.haze end)
    end

    for part, _ in pairs(neonCache) do
        if part and part.Parent and part:IsA("BasePart") then
            if masterSnapshot.neonCacheSnapshot[part] then
                pcall(function() part.Material = Enum.Material.Neon end)
            end
        end
    end
    neonCache = {}

    if masterSnapshot.noFog == false then
        Lighting.FogStart = OriginalLightingState.FogStart or 0
        Lighting.FogEnd = OriginalLightingState.FogEnd or 1000
        local atm = Lighting:FindFirstChildOfClass("Atmosphere")
        if atm and OriginalAtmosphereProps then
            pcall(function()
                atm.Density = OriginalAtmosphereProps.Density
                atm.Offset = OriginalAtmosphereProps.Offset
                atm.Color = OriginalAtmosphereProps.Color
            end)
        end
    end
end

LegitTab:CreateToggle({
    Name = "Enable All Settings",
    CurrentValue = false,
    Callback = function(v)
        if v then
            if masterActive then return end
            takeSnapshot()
            masterActive = true
            applyAllSettings()
            notify("Legit", "Enable All Settings ON (temporary override active)", 3)
        else
            if not masterActive then return end
            restoreAllSettings()
            masterActive = false
            notify("Legit", "Enable All Settings OFF (reverted)", 3)
        end
    end
})

-- Events debug buttons
local EventsList = {
    "InteractPromptEvent",
    "PlayDialogueSoundEvent",
    "RevealObbyPartEvent",
    "SetCameraZoomEvent",
    "ShowDialogueGuiEvent",
    "ShowFinishObbyMessage",
    "ShowPullingMessageEvent",
    "ShowTeleportImageEvent",
    "ShowTeleportMessageEvent",
    "StartChatDialogEvent",
    "UnlockClassicCameraEvent",
    "UnlockFirstPersonEvent",
    "UpdateLeaderboardEvent",
    "WhiteScreenFadeEvent"
}

for _, evName in ipairs(EventsList) do
    EventsTab:CreateButton({
        Name = evName,
        Callback = function()
            local ev = ReplicatedStorage:FindFirstChild(evName)
            if ev and ev:IsA("RemoteEvent") then
                notify("Events", evName .. " exists (firing disabled for safety).", 3)
            else
                notify("Events", evName .. " not found", 3)
            end
        end
    })
end

-- Stages helper to add buttons easily
local function addStageButton(name, cfOrFunc)
    StagesTab:CreateButton({
        Name = name,
        Callback = function()
            local targetCF = type(cfOrFunc) == "function" and cfOrFunc() or cfOrFunc
            if targetCF then
                safeTeleportToCFrame(targetCF)
                notify("Stages", "Teleported to " .. name, 2)
            else
                notify("Stages", "Target not found", 2)
            end
        end
    })
end

-- Stage buttons - kept, updated with new coordinates
addStageButton("Spawn (Stage 1)", CFrame.new(8294,4,-543))
addStageButton("End (Stage 1)", CFrame.new(8622,4,-544))
addStageButton("Markiplier Start (Stage 2)", function()
    local dest = Workspace:FindFirstChild("TeleportDestination")
    if dest and dest:IsA("BasePart") then
        return dest.CFrame + Vector3.new(0,5,0)
    else
        return CFrame.new(8534,36,55)
    end
end)
addStageButton("Obby Start (Stage 3)", CFrame.new(9830,42,303))
addStageButton("Corrupt Baseplate Start (Stage 4)", CFrame.new(10008,50,3089))
addStageButton("Corrupt Baseplate End (Stage 4)", CFrame.new(10627,50,3110))
addStageButton("Asylum Start (Stage 5)", CFrame.new(10641,129,5048))
addStageButton("Grandfather Clock (Stage 5)", CFrame.new(10616,127,5013))
addStageButton("Asylum Room (Stage 5)", CFrame.new(10632,127,5210))
addStageButton("Altar (Stage 5)", CFrame.new(10578,127,5278))
addStageButton("Mango Ball (Stage 5)", CFrame.new(10552,152,5182))
addStageButton("Black Room (Stage 5)", CFrame.new(10618,127,5279))
addStageButton("BOSSFIGHT BOII (Stage 6)", CFrame.new(10606, 126, 6068))

-- Stage Loader - improved list retained
LegitTab:CreateButton({
    Name = "Stage Loader",
    Callback = function()
        if not HRP then notify("Stage Loader", "Root part is missing.", 3); return end
        local origin = HRP.CFrame
        notify("Stage Loader", "Scanning stage streaming state...", 3)

        local allStages = {
            CFrame.new(8294,4,-543),
            CFrame.new(8622,4,-544),
            (Workspace:FindFirstChild("TeleportDestination") and Workspace.TeleportDestination:IsA("BasePart") and (Workspace.TeleportDestination.CFrame + Vector3.new(0,5,0))) or CFrame.new(8534,36,55),
            CFrame.new(9830,42,303),
            CFrame.new(10008,50,3089),
            CFrame.new(10627,50,3110),
            CFrame.new(10641,129,5048),
            CFrame.new(10616,127,5013),
            CFrame.new(10632,127,5210),
            CFrame.new(10578,127,5278), -- Altar
            CFrame.new(10552,152,5182), -- Mango Ball
            CFrame.new(10618,127,5279),  -- Black Room
            CFrame.new(10606, 126, 6068)
        }

        local toVisit = {}
        for _, cf in ipairs(allStages) do
            if not isAreaStreamed(cf.Position, 25, 6) then
                table.insert(toVisit, cf)
            end
        end

        if #toVisit == 0 then
            notify("Stage Loader", "All stage areas appear streamed already, nothing to do.", 3)
            return
        end

        local startTick = tick()
        local aborted = false
        for _, cf in ipairs(toVisit) do
            if tick() - startTick > 10 then aborted = true; break end
            pcall(function() HRP.CFrame = cf end)
            local t0 = tick()
            local okStream = false
            repeat
                task.wait(0.25)
                if isAreaStreamed(cf.Position, 25, 6) then okStream = true; break end
            until tick() - t0 > 3 or tick() - startTick > 10
            if not okStream then
                pcall(function() HRP.CFrame = origin end)
                notify("Stage Loader", "Stage area failed to stream; restored origin.", 4)
                aborted = true
                break
            end
            task.wait(0.6)
        end
        pcall(function() if origin then HRP.CFrame = origin end end)
        if aborted then
            notify("Stage Loader", "Sequence aborted (timeout/stream failure).", 4)
        else
            notify("Stage Loader", "All unstreamed stages visited and returned.", 4)
        end
    end
})

-- Third person unlock attempt on load (teleport + jump)
task.spawn(function()
    task.wait(0.8)
    if HRP and Humanoid then
        local originalPos = HRP.CFrame
        local stage3CF = CFrame.new(9830,42,303)
        safeTeleportToCFrame(stage3CF + Vector3.new(0,3,0))
        task.wait(1) -- hold to ensure the unlock part loads
        pcall(function() Humanoid:ChangeState(Enum.HumanoidStateType.Jumping) end)
        task.wait(0.5)
        safeTeleportToCFrame(originalPos)
        notify("Third Person", "Attempted unlock.", 2)
    end
end)

-- ProximityPrompt AutoFarm (keeps original behavior)
local autoFarmActive = false
local autoFarmConnection = nil
local originalCFrame = nil

LegitTab:CreateToggle({
    Name = "ProximityPrompt AutoFarm",
    CurrentValue = false,
    Callback = function(state)
        autoFarmActive = state
        local interactPart = Workspace:FindFirstChild("Interact")
        if not interactPart then
            notify("Legit", "Interact part not found in workspace", 3)
            return
        end
        local prompt = interactPart:FindFirstChildOfClass("ProximityPrompt")
        if not prompt then
            notify("Legit", "ProximityPrompt 'Interact' not found", 3)
            return
        end

        if state then
            if not HRP then notify("Legit", "HumanoidRootPart missing", 3); return end
            originalCFrame = HRP.CFrame

            -- Freeze player
            if Humanoid then pcall(function() Humanoid.WalkSpeed = 0; Humanoid.JumpPower = 0 end) end

            -- Teleport to interact part
            safeTeleportToCFrame(interactPart.CFrame + Vector3.new(0,3,0))

            -- Modify prompt properties safely
            pcall(function()
                prompt.HoldDuration = 0
                prompt.RequiresLineOfSight = false
                prompt.MaxActivationDistance = 200
            end)

            -- Spam the prompt
            autoFarmConnection = RunService.Heartbeat:Connect(function()
                if autoFarmActive then
                    pcall(function()
                        prompt:InputHoldBegin()
                        prompt:InputHoldEnd()
                    end)
                end
            end)
            notify("Legit", "ProximityPrompt AutoFarm enabled", 2)

        else
            -- Stop spamming
            if autoFarmConnection then autoFarmConnection:Disconnect(); autoFarmConnection = nil end

            -- Restore player movement
            if Humanoid and _G.whatHub_ws and _G.whatHub_jp then
                pcall(function()
                    Humanoid.WalkSpeed = _G.whatHub_ws
                    Humanoid.JumpPower = _G.whatHub_jp
                end)
            end

            -- Teleport back to original position
            if originalCFrame then
                safeTeleportToCFrame(originalCFrame)
                originalCFrame = nil
            end

            notify("Legit", "ProximityPrompt AutoFarm disabled", 2)
        end
    end
})

-- Optimization Machine 9000 - helper to remove by path array
local function removeByPath(pathArray)
    if type(pathArray) ~= "table" or #pathArray == 0 then return false end
    local ok, target = pcall(function()
        local cur = Workspace
        for i, nm in ipairs(pathArray) do
            if not cur then return nil end
            local child = cur:FindFirstChild(nm)
            if not child then return nil end
            cur = child
        end
        return cur
    end)
    if not ok or not target then return false end
    -- detach then destroy to minimize transient overhead
    pcall(function() target.Parent = nil end)
    pcall(function() target:Destroy() end)
    return true
end

OptimizationTab:CreateButton({
    Name = "Asylum Decorations (remove)",
    Callback = function()
        local path = {"All Stages [1-6]","Asylum [Stage5]","Decorations [STAGE5]"}
        local ok = removeByPath(path)
        notify("Optimization", ok and "Asylum Decorations removed" or "Asylum Decorations not found", ok and 2 or 4)
    end
})

OptimizationTab:CreateButton({
    Name = "Mark Particles (remove)",
    Callback = function()
        local path = {"All Stages [1-6]","Markiplier [STAGE2]","MarkParticleEmitter"}
        local ok = removeByPath(path)
        notify("Optimization", ok and "Mark ParticleEmitter removed" or "Mark ParticleEmitter not found", ok and 2 or 4)
    end
})

OptimizationTab:CreateButton({
    Name = "Error Trees (remove)",
    Callback = function()
        local path = {"All Stages [1-6]","Corrupt Baseplate [STAGE4]","Error Trees"}
        local ok = removeByPath(path)
        notify("Optimization", ok and "Error Trees removed" or "Error Trees not found", ok and 2 or 4)
    end
})

OptimizationTab:CreateButton({
    Name = "Extra (remove Mango/Mustard/Signs/etc)",
    Callback = function()
        local removedCount = 0
        local candidates = {"Mango","Mustard","Mustard Droppings","Plastic Chair","Signs"}
        for _, name in ipairs(candidates) do
            local ok1 = false
            pcall(function()
                local inst = Workspace:FindFirstChild(name)
                if inst then
                    inst.Parent = nil
                    inst:Destroy()
                    ok1 = true
                end
            end)
            if not ok1 then
                pcall(function()
                    local wfold = Workspace:FindFirstChild("Workspace")
                    if wfold and wfold:FindFirstChild(name) then
                        local inst2 = wfold:FindFirstChild(name)
                        inst2.Parent = nil
                        inst2:Destroy()
                        ok1 = true
                    end
                end)
            end
            if ok1 then removedCount = removedCount + 1 end
        end
        if removedCount > 0 then
            notify("Optimization", "Removed " .. tostring(removedCount) .. " extra folders/items", 3)
        else
            notify("Optimization", "No extra folders found to remove", 3)
        end
    end
})

-- Final notification
notify("whatHub v1.5", "Loaded successfully - enjoy ❤", 4)
dprint("whatHub v1.5 initialized (Optimization Machine 9000 added).")

Features & Information

- interaction auto farm - tp to all stages - WS/JP slider - remove decorations - load infinite yield button
#open source#auto farm

Community Comments (0)

No comments yet for this script.