
Key Required Patched

local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local VirtualInputManager = game:GetService("VirtualInputManager")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local chestEnabled = false
local chestRunning = false
local npcKillEnabled = false
local autoOpenEnabled = false
local lootVacuumEnabled = false
local CHECK_DELAY = 0.4
local MAX_CHESTS = 8
local skippedPrompts = {}
local selectedChestTypes = {}
local selectedNPCTypes = {}
local selectedOpenTypes = {}
local chestCache = {}
local function checkIgnore(instance)
if not instance then return false end
local nameLower = string.lower(instance.Name)
if nameLower:find("world") or nameLower:find("omnius") or nameLower:find("witch") or nameLower:find("merchant") then return true end
local current = instance.Parent
while current and current ~= workspace do
local pName = string.lower(current.Name)
if pName:find("world") or pName:find("omnius") or pName:find("witch") or pName:find("merchant") then return true end
current = current.Parent
end
return false
end
local function isChest(instance)
if not instance then return false end
local nameLower = string.lower(instance.Name)
return (instance:IsA("Model") or instance:IsA("BasePart")) and (nameLower:find("chest") or nameLower:find("diamond")) and not checkIgnore(instance)
end
local function refreshChestCache()
table.clear(chestCache)
for _, prompt in ipairs(workspace:GetDescendants()) do
if prompt:IsA("ProximityPrompt") and prompt.Parent and isChest(prompt.Parent) then
table.insert(chestCache, prompt)
end
end
end
local function getPos(prompt)
local parent = prompt.Parent if not parent then return end
if parent:IsA("Attachment") then return parent.WorldPosition end
if parent:IsA("BasePart") then return parent.Position end
if parent:IsA("Model") then return parent:GetPivot().Position end
end
local function getChests(root)
local list, hasSelection = {}, false
for _, v in pairs(selectedChestTypes) do if v then hasSelection = true break end end
for _, prompt in ipairs(chestCache) do
if prompt and prompt.Parent and prompt.Enabled and not skippedPrompts[prompt] then
if not hasSelection or selectedChestTypes[prompt.Parent.Name] then
local pos = getPos(prompt)
if pos then table.insert(list, {prompt = prompt, pos = pos, dist = (root.Position - pos).Magnitude}) end
end
end
end
table.sort(list, function(a, b) return a.dist < b.dist end)
return {unpack(list, 1, math.min(#list, MAX_CHESTS))}
end
local function collectLoop()
if chestRunning then return end chestRunning = true
while chestEnabled do
task.wait(CHECK_DELAY)
local character = player.Character
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
local root = character and character:FindFirstChild("HumanoidRootPart")
if humanoid and humanoid.Health > 0 and root then
refreshChestCache()
local targets = getChests(root)
if #targets > 0 then
local originalCFrame = root.CFrame
local savedCollides = {}
for _, part in ipairs(character:GetChildren()) do
if part:IsA("BasePart") then savedCollides[part] = part.CanCollide part.CanCollide = false end
end
for _, data in ipairs(targets) do
if not chestEnabled then break end
local prompt, pos = data.prompt, data.pos
if prompt.Parent and prompt.Enabled and pos then
root.CFrame = CFrame.lookAt(pos + Vector3.new(0, 0.5, 1.2), pos)
if workspace.CurrentCamera then workspace.CurrentCamera.CFrame = CFrame.lookAt(workspace.CurrentCamera.CFrame.Position, pos) end
task.wait(0.18)
if prompt.Parent and prompt.Enabled then
local keyCode = prompt.KeyboardKeyCode or Enum.KeyCode.E
pcall(function()
VirtualInputManager:SendKeyEvent(true, keyCode, false, game)
task.wait(prompt.HoldDuration > 0 and prompt.HoldDuration + 0.05 or 0.02)
VirtualInputManager:SendKeyEvent(false, keyCode, false, game)
end)
if prompt.Parent and prompt.Enabled then
pcall(function() prompt:InputHoldBegin() task.wait(math.max(prompt.HoldDuration, 0.02)) prompt:InputHoldEnd() end)
end
local start = os.clock()
while prompt.Parent and prompt.Enabled and os.clock() - start < 0.35 do task.wait(0.02) end
if prompt.Parent and prompt.Enabled then skippedPrompts[prompt] = true end
end
task.wait(0.03)
end
end
for part, col in pairs(savedCollides) do if part and part.Parent then part.CanCollide = col end end
if root and root.Parent then root.CFrame = originalCFrame end
else
task.wait(0.5)
end
end
end
chestRunning = false
end
local function lootVacuumLoop()
while lootVacuumEnabled do
local character = player.Character
local root = character and character:FindFirstChild("HumanoidRootPart")
if root then
local workspaceChildren = workspace:GetChildren()
for i = 1, #workspaceChildren do
if not lootVacuumEnabled then break end
local item = workspaceChildren[i]
local nameLower = string.lower(item.Name)
if nameLower:find("lootbag") or
nameLower:find("elder") or
nameLower:find("diamond") or
nameLower:find("darkness") or
(nameLower:find("chest") and not item:FindFirstChildOfClass("ProximityPrompt")) then
pcall(function()
if item:IsA("BasePart") and not item.Anchored then
item.CFrame = root.CFrame
elseif item:IsA("Model") then
item:PivotTo(root.CFrame)
end
local prompt = item:FindFirstChildWhichIsA("ProximityPrompt", true)
if prompt and prompt.Enabled then
fireproximityprompt(prompt)
end
end)
end
end
end
task.wait(0.15)
end
end
local function openInventoryLoop()
while autoOpenEnabled do
local backpack = player:FindFirstChildOfClass("Backpack")
local character = player.Character
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
if backpack and humanoid and humanoid.Health > 0 then
local hasOpenSelection = false
for _, v in pairs(selectedOpenTypes) do if v then hasOpenSelection = true break end end
local openedThisFrame = 0
local maxPerFrame = 15
local backpackTools = backpack:GetChildren()
for i = 1, #backpackTools do
if openedThisFrame >= maxPerFrame or not autoOpenEnabled then break end
local tool = backpackTools[i]
if tool:IsA("Tool") then
local toolName = string.lower(tool.Name)
if not hasOpenSelection or selectedOpenTypes[tool.Name] then
if toolName:find("chest") or toolName:find("diamond") or toolName:find("darkness") then
openedThisFrame = openedThisFrame + 1
task.spawn(function()
pcall(function()
if tool:FindFirstChild("OpenAll") then
tool.OpenAll:FireServer()
elseif tool:FindFirstChild("Open") then
tool.Open:FireServer(true)
else
humanoid:EquipTool(tool)
tool:Activate()
end
end)
end)
elseif toolName:find("lootbag") then
openedThisFrame = openedThisFrame + 1
for j = 1, 5 do
task.spawn(function()
pcall(function()
humanoid:EquipTool(tool)
tool:Activate()
end)
end)
end
end
end
end
end
end
RunService.Heartbeat:Wait()
end
end
local function npcKillLoop()
while npcKillEnabled do
local character = player.Character
pcall(function()
sethiddenproperty(player, "SimulationRadius", 112412400000)
sethiddenproperty(player, "MaxSimulationRadius", 112412400000)
end)
local hasNpcSelection = false
for npcName, selected in pairs(selectedNPCTypes) do
if selected == true then hasNpcSelection = true break end
end
local allObjects = workspace:GetDescendants()
for i = 1, #allObjects do
local d = allObjects[i]
if d and d:IsA("Humanoid") and d.Parent and d.Parent ~= character and not checkIgnore(d.Parent) then
if not hasNpcSelection or selectedNPCTypes[d.Parent.Name] == true then
if d.Health > 0 then
pcall(function()
d.Health = 0
end)
end
end
end
end
task.wait(0.3)
end
end
-- GUI Setup
local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui", 10) or player:FindFirstChildOfClass("PlayerGui"))
gui.Name, gui.ResetOnSpawn = "ChestCollectorPremiumMenu", false
local panel = Instance.new("Frame", gui)
panel.Size, panel.Position, panel.BackgroundColor3, panel.BorderSizePixel, panel.Active = UDim2.fromOffset(640, 410), UDim2.new(0.5, -320, 0.3, 0), Color3.fromRGB(20, 20, 26), 0, true
Instance.new("UICorner", panel).CornerRadius = UDim.new(0, 12)
local stroke = Instance.new("UIStroke", panel) stroke.Color, stroke.Thickness = Color3.fromRGB(75, 70, 105), 1.5
local function makeButton(text, size, position, parent, bgCol)
local button = Instance.new("TextButton", parent)
button.Text, button.Size, button.Position, button.BackgroundColor3, button.TextColor3, button.Font, button.TextSize, button.BorderSizePixel = text, size, position, bgCol or Color3.fromRGB(40, 40, 52), Color3.new(1, 1, 1), Enum.Font.GothamBold, 13, 0
Instance.new("UICorner", button).CornerRadius = UDim.new(0, 8)
return button
end
local title = Instance.new("TextLabel", panel)
title.Size, title.Position, title.BackgroundTransparency, title.Text, title.TextColor3, title.Font, title.TextSize, title.TextXAlignment = UDim2.new(1, -80, 0, 40), UDim2.fromOffset(16, 0), 1, "ULTIMATE PREMIUM HUB v7", Color3.fromRGB(190, 180, 255), Enum.Font.GothamBlack, 16, 0
local hide = makeButton("—", UDim2.fromOffset(28, 28), UDim2.new(1, -66, 0, 8), panel, Color3.fromRGB(35, 35, 45))
local close = makeButton("X", UDim2.fromOffset(28, 28), UDim2.new(1, -34, 0, 8), panel, Color3.fromRGB(65, 30, 30))
-- Top Row Main Toggles (Perfect 4-Column Layout with equal spacing)
local toggle = makeButton("Auto Farm: OFF", UDim2.fromOffset(145, 42), UDim2.fromOffset(12, 50), panel, Color3.fromRGB(45, 45, 65))
local killToggle = makeButton("Kill NPC: OFF", UDim2.fromOffset(145, 42), UDim2.fromOffset(169, 50), panel, Color3.fromRGB(45, 45, 65))
local vacuumToggle = makeButton("Loot Vacuum: OFF", UDim2.fromOffset(145, 42), UDim2.fromOffset(326, 50), panel, Color3.fromRGB(45, 45, 65))
local openToggle = makeButton("Auto Open: OFF", UDim2.fromOffset(145, 42), UDim2.fromOffset(483, 50), panel, Color3.fromRGB(45, 45, 65))
local sep = Instance.new("Frame", panel)
sep.Size, sep.Position, sep.BackgroundColor3, sep.BorderSizePixel = UDim2.new(1, -24, 0, 1), UDim2.fromOffset(12, 105), Color3.fromRGB(40, 40, 50), 0
-- 3 Columns Header Setup
local exT = Instance.new("TextLabel", panel)
exT.Size, exT.Position, exT.BackgroundTransparency, exT.Text, exT.TextColor3, exT.Font, exT.TextSize, exT.TextXAlignment = UDim2.fromOffset(165, 20), UDim2.fromOffset(12, 115), 1, "CHEST FILTER", Color3.fromRGB(130, 130, 150), Enum.Font.GothamBold, 11, 0
local refChest = makeButton("↻", UDim2.fromOffset(24, 20), UDim2.fromOffset(183, 115), panel, Color3.fromRGB(35, 150, 60)) refChest.TextSize = 12
local exT2 = Instance.new("TextLabel", panel)
exT2.Size, exT2.Position, exT2.BackgroundTransparency, exT2.Text, exT2.TextColor3, exT2.Font, exT2.TextSize, exT2.TextXAlignment = UDim2.fromOffset(165, 20), UDim2.fromOffset(221, 115), 1, "NPC TARGETS", Color3.fromRGB(130, 130, 150), Enum.Font.GothamBold, 11, 0
local refNPC = makeButton("↻", UDim2.fromOffset(24, 20), UDim2.fromOffset(392, 115), panel, Color3.fromRGB(35, 150, 60)) refNPC.TextSize = 12
local exT3 = Instance.new("TextLabel", panel)
exT3.Size, exT3.Position, exT3.BackgroundTransparency, exT3.Text, exT3.TextColor3, exT3.Font, exT3.TextSize, exT3.TextXAlignment = UDim2.fromOffset(165, 20), UDim2.fromOffset(430, 115), 1, "INVENTORY OPENER", Color3.fromRGB(130, 130, 150), Enum.Font.GothamBold, 11, 0
local refOpen = makeButton("↻", UDim2.fromOffset(24, 20), UDim2.fromOffset(604, 115), panel, Color3.fromRGB(35, 150, 60)) refOpen.TextSize = 12
-- 3 Identical Scrolling Frames
local scr = Instance.new("ScrollingFrame", panel)
scr.Size, scr.Position, scr.BackgroundColor3, scr.BorderSizePixel, scr.CanvasSize, scr.ScrollBarThickness, scr.ScrollBarImageColor3 = UDim2.fromOffset(195, 245), UDim2.fromOffset(12, 145), Color3.fromRGB(14, 14, 20), 0, UDim2.new(0, 0, 0, 0), 4, Color3.fromRGB(70, 70, 90)
Instance.new("UICorner", scr).CornerRadius = UDim.new(0, 6)
local lay = Instance.new("UIListLayout", scr) lay.Padding, lay.SortOrder = UDim.new(0, 5), Enum.SortOrder.LayoutOrder
local scrNPC = Instance.new("ScrollingFrame", panel)
scrNPC.Size, scrNPC.Position, scrNPC.BackgroundColor3, scrNPC.BorderSizePixel, scrNPC.CanvasSize, scrNPC.ScrollBarThickness, scrNPC.ScrollBarImageColor3 = UDim2.fromOffset(195, 245), UDim2.fromOffset(221, 145), Color3.fromRGB(14, 14, 20), 0, UDim2.new(0, 0, 0, 0), 4, Color3.fromRGB(70, 70, 90)
Instance.new("UICorner", scrNPC).CornerRadius = UDim.new(0, 6)
local layNPC = Instance.new("UIListLayout", scrNPC) layNPC.Padding, layNPC.SortOrder = UDim.new(0, 5), Enum.SortOrder.LayoutOrder
local scrOpen = Instance.new("ScrollingFrame", panel)
scrOpen.Size, scrOpen.Position, scrOpen.BackgroundColor3, scrOpen.BorderSizePixel, scrOpen.CanvasSize, scrOpen.ScrollBarThickness, scrOpen.ScrollBarImageColor3 = UDim2.fromOffset(195, 245), UDim2.fromOffset(433, 145), Color3.fromRGB(14, 14, 20), 0, UDim2.new(0, 0, 0, 0), 4, Color3.fromRGB(70, 70, 90)
Instance.new("UICorner", scrOpen).CornerRadius = UDim.new(0, 6)
local layOpen = Instance.new("UIListLayout", scrOpen) layOpen.Padding, layOpen.SortOrder = UDim.new(0, 5), Enum.SortOrder.LayoutOrder
-- Open Menu Button
local reo = makeButton("Open Menu", UDim2.fromOffset(140, 40), UDim2.new(0, 20, 0.8, 0), gui, Color3.fromRGB(30, 30, 40)) reo.Visible = false Instance.new("UIStroke", reo).Color = Color3.fromRGB(75, 70, 105)
-- List Updates Functions
local function updateChestList()
for _, child in ipairs(scr:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end
refreshChestCache()
local chestNames = {} for _, prompt in ipairs(chestCache) do if prompt.Parent then chestNames[prompt.Parent.Name] = true end end
for name, _ in pairs(chestNames) do
local cb = Instance.new("TextButton", scr)
cb.Size, cb.Font, cb.TextSize, cb.Text, cb.TextXAlignment, cb.BorderSizePixel = UDim2.new(1, -6, 0, 32), Enum.Font.Gotham, 12, " " .. name, Enum.TextXAlignment.Left, 0
Instance.new("UICorner", cb).CornerRadius = UDim.new(0, 5)
cb.BackgroundColor3 = selectedChestTypes[name] and Color3.fromRGB(40, 85, 50) or Color3.fromRGB(28, 28, 38)
cb.TextColor3 = selectedChestTypes[name] and Color3.new(1, 1, 1) or Color3.fromRGB(160, 160, 180)
cb.Activated:Connect(function()
selectedChestTypes[name] = not selectedChestTypes[name] and true or nil
cb.BackgroundColor3 = selectedChestTypes[name] and Color3.fromRGB(40, 85, 50) or Color3.fromRGB(28, 28, 38)
cb.TextColor3 = selectedChestTypes[name] and Color3.new(1, 1, 1) or Color3.fromRGB(160, 160, 180)
end)
end
scr.CanvasSize = UDim2.new(0, 0, 0, lay.AbsoluteContentSize.Y + 10)
end
local function updateNPCList()
for _, child in ipairs(scrNPC:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end
local npcNames = {}
local allObjects = workspace:GetDescendants()
for i = 1, #allObjects do
local d = allObjects[i]
if d and d:IsA("Humanoid") and d.Parent and d.Parent ~= player.Character and not checkIgnore(d.Parent) then
local cleanName = d.Parent.Name:gsub("%s+", "")
if #cleanName > 0 and cleanName ~= "Model" and cleanName ~= "Part" then
npcNames[d.Parent.Name] = true
end
end
end
for name, _ in pairs(npcNames) do
local cb = Instance.new("TextButton", scrNPC)
cb.Size, cb.Font, cb.TextSize, cb.Text, cb.TextXAlignment, cb.BorderSizePixel = UDim2.new(1, -6, 0, 32), Enum.Font.Gotham, 12, " " .. name, Enum.TextXAlignment.Left, 0
Instance.new("UICorner", cb).CornerRadius = UDim.new(0, 5)
cb.BackgroundColor3 = selectedNPCTypes[name] and Color3.fromRGB(85, 35, 35) or Color3.fromRGB(28, 28, 38)
cb.TextColor3 = selectedNPCTypes[name] and Color3.new(1, 1, 1) or Color3.fromRGB(160, 160, 180)
cb.Activated:Connect(function()
selectedNPCTypes[name] = not selectedNPCTypes[name] and true or nil
cb.BackgroundColor3 = selectedNPCTypes[name] and Color3.fromRGB(85, 35, 35) or Color3.fromRGB(28, 28, 38)
cb.TextColor3 = selectedNPCTypes[name] and Color3.new(1, 1, 1) or Color3.fromRGB(160, 160, 180)
end)
end
scrNPC.CanvasSize = UDim2.new(0, 0, 0, layNPC.AbsoluteContentSize.Y + 10)
end
local function updateOpenList()
for _, child in ipairs(scrOpen:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end
local openNames = {}
local bp = player:FindFirstChildOfClass("Backpack")
if bp then
for _, tool in ipairs(bp:GetChildren()) do
if tool:IsA("Tool") and (string.lower(tool.Name):find("lootbag") or string.lower(tool.Name):find("chest") or string.lower(tool.Name):find("diamond") or string.lower(tool.Name):find("darkness")) then
openNames[tool.Name] = true
end
end
end
for name, _ in pairs(openNames) do
local cb = Instance.new("TextButton", scrOpen)
cb.Size, cb.Font, cb.TextSize, cb.Text, cb.TextXAlignment, cb.BorderSizePixel = UDim2.new(1, -6, 0, 32), Enum.Font.Gotham, 11, " " .. name, Enum.TextXAlignment.Left, 0
Instance.new("UICorner", cb).CornerRadius = UDim.new(0, 5)
cb.BackgroundColor3 = selectedOpenTypes[name] and Color3.fromRGB(35, 60, 85) or Color3.fromRGB(28, 28, 38)
cb.TextColor3 = selectedOpenTypes[name] and Color3.new(1, 1, 1) or Color3.fromRGB(160, 160, 180)
cb.Activated:Connect(function()
selectedOpenTypes[name] = not selectedOpenTypes[name] and true or nil
cb.BackgroundColor3 = selectedOpenTypes[name] and Color3.fromRGB(35, 60, 85) or Color3.fromRGB(28, 28, 38)
cb.TextColor3 = selectedOpenTypes[name] and Color3.new(1, 1, 1) or Color3.fromRGB(160, 160, 180)
end)
end
scrOpen.CanvasSize = UDim2.new(0, 0, 0, layOpen.AbsoluteContentSize.Y + 10)
end
-- Button Logic Connections
toggle.Activated:Connect(function()
chestEnabled = not chestEnabled
toggle.Text = chestEnabled and "Auto Farm: ON" or "Auto Farm: OFF"
toggle.BackgroundColor3 = chestEnabled and Color3.fromRGB(45, 95, 55) or Color3.fromRGB(45, 45, 65)
if chestEnabled then task.spawn(collectLoop) end
end)
killToggle.Activated:Connect(function()
npcKillEnabled = not npcKillEnabled
killToggle.Text = npcKillEnabled and "Kill NPC: ON" or "Kill NPC: OFF"
killToggle.BackgroundColor3 = npcKillEnabled and Color3.fromRGB(95, 45, 45) or Color3.fromRGB(45, 45, 65)
if npcKillEnabled then task.spawn(npcKillLoop) end
end)
vacuumToggle.Activated:Connect(function()
lootVacuumEnabled = not lootVacuumEnabled
vacuumToggle.Text = lootVacuumEnabled and "Loot Vacuum: ON" or "Loot Vacuum: OFF"
vacuumToggle.BackgroundColor3 = lootVacuumEnabled and Color3.fromRGB(45, 95, 55) or Color3.fromRGB(45, 45, 65)
if lootVacuumEnabled then task.spawn(lootVacuumLoop) end
end)
openToggle.Activated:Connect(function()
autoOpenEnabled = not autoOpenEnabled
openToggle.Text = autoOpenEnabled and "Auto Open: ON" or "Auto Open: OFF"
openToggle.BackgroundColor3 = autoOpenEnabled and Color3.fromRGB(45, 95, 55) or Color3.fromRGB(45, 45, 65)
if autoOpenEnabled then task.spawn(openInventoryLoop) end
end)
refChest.Activated:Connect(function() refChest.Text = "..." updateChestList() task.wait(0.1) refChest.Text = "↻" end)
refNPC.Activated:Connect(function() refNPC.Text = "..." updateNPCList() task.wait(0.1) refNPC.Text = "↻" end)
refOpen.Activated:Connect(function() refOpen.Text = "..." updateOpenList() task.wait(0.1) refOpen.Text = "↻" end)
hide.Activated:Connect(function() panel.Visible = false reo.Visible = true end)
reo.Activated:Connect(function() panel.Visible = true reo.Visible = false end)
close.Activated:Connect(function() chestEnabled, npcKillEnabled, autoOpenEnabled, lootVacuumEnabled = false, false, false, false gui:Destroy() end)
-- Initialization
updateChestList()
updateNPCList()
updateOpenList()
-- Smooth Dragging System
local dragging = false
local dragInput, dragStart, startPosition
panel.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragging = true
dragStart = input.Position
startPosition = panel.Position
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragging = false
end
end)
panel.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
UserInputService.InputChanged:Connect(function(input)
if dragging and input == dragInput then
local delta = input.Position - dragStart
panel.Position = UDim2.new(
startPosition.X.Scale,
startPosition.X.Offset + delta.X,
startPosition.Y.Scale,
startPosition.Y.Offset + delta.Y
)
end
end)No comments yet for this script.

