local UserInputService = game:GetService("UserInputService") local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local RunService = game:GetService("RunService") local Workspace = game:GetService("Workspace") local VirtualInputManager = game:GetService("VirtualInputManager") local TweenService = game:GetService("TweenService") local LocalPlayer = Players.LocalPlayer local Camera = Workspace.CurrentCamera local ViewportSize = Camera.ViewportSize local guiHovered = false local gameFolder = Workspace:WaitForChild("#GAME", 10) local foldersFolder = gameFolder and gameFolder:WaitForChild("Folders", 5) local humanoidFolder = foldersFolder and foldersFolder:WaitForChild("HumanoidFolder", 5) local mainFolder = humanoidFolder and humanoidFolder:WaitForChild("NPCFolder", 5) local eventsFolder = ReplicatedStorage:WaitForChild("Events", 10) local remote = eventsFolder and eventsFolder:WaitForChild("MainAttack", 5) if not mainFolder then warn("NPCFolder missing") return end if not remote then warn("MainAttack RemoteEvent missing") return end -- Toggles local autoEatShoot = true local autoWalkEnabled = true local kingSlayerEnabled = true -- We keep this for legacy reasons but will control weapon selection via dropdown -- Selected weapon defaults to King Slayer local selectedWeapon = "King Slayer" -- Equip the selected weapon from inventory local function equipSelectedWeapon() local character = LocalPlayer.Character local backpack = LocalPlayer:FindFirstChild("Backpack") if not character or not backpack then return end local tool = character:FindFirstChild(selectedWeapon) or backpack:FindFirstChild(selectedWeapon) if tool and tool.Parent == backpack then tool.Parent = character end end -- Equip on spawn LocalPlayer.CharacterAdded:Connect(function() task.wait(1) equipSelectedWeapon() end) if LocalPlayer.Character then equipSelectedWeapon() end -- Helper functions local function getDeadNPCs() local list = {} for _, npc in ipairs(mainFolder:GetChildren()) do if npc:IsA("Model") then local humanoid = npc:FindFirstChildOfClass("Humanoid") if humanoid and (humanoid.Health <= 0 or npc.Name:find("Dead")) then table.insert(list, npc) end end end return list end local ignoreNPCs = { "Bas", "Shopkeeper", "Bug", "Pets", "Stickest Bug", "Pet", "Stick Bug", "Sticker Bug", "King", "Dead" } local function isIgnored(name) for _, pattern in ipairs(ignoreNPCs) do if name:lower():find(pattern:lower()) then return true end end return false end local function getAliveNPCs() local list = {} for _, npc in ipairs(mainFolder:GetChildren()) do if npc:IsA("Model") and not isIgnored(npc.Name) then local humanoid = npc:FindFirstChildOfClass("Humanoid") local hrp = npc:FindFirstChild("HumanoidRootPart") if humanoid and humanoid.Health > 0 and hrp then table.insert(list, npc) end end end return list end local function getClosestAliveNPC() local aliveNPCs = getAliveNPCs() local closestNPC, closestDistance = nil, math.huge local origin = Camera.CFrame.Position for _, npc in ipairs(aliveNPCs) do local hrp = npc:FindFirstChild("HumanoidRootPart") if hrp then local dist = (hrp.Position - origin).Magnitude if dist < closestDistance then closestDistance = dist closestNPC = npc end end end return closestNPC end local function getValidParts(model) local parts = {} for _, part in ipairs(model:GetDescendants()) do if part:IsA("BasePart") and not part:GetAttribute("IsGettingEaten") then table.insert(parts, part) end end return parts end RunService.Heartbeat:Connect(function() if autoEatShoot then local deadNPCs = getDeadNPCs() -- Override list logic local eatOverrideList = { "OOOOOOMEGA", "Diamond", "Golden", "Werewolf", "Ruby", "Emerald", "Amethyst", "Mighty", "Cracked", "Dark" } local function isInOverrideList(name) for _, override in ipairs(eatOverrideList) do if name:lower():find(override:lower()) then return true end end return false end local overrideDead = {} local otherDead = {} for _, npc in ipairs(deadNPCs) do if isInOverrideList(npc.Name) then table.insert(overrideDead, npc) else table.insert(otherDead, npc) end end local targetNpc = nil local parts = nil if #overrideDead > 0 then for _, npc in ipairs(overrideDead) do local tryParts = getValidParts(npc) if #tryParts > 0 then targetNpc = npc parts = tryParts break end end elseif #otherDead > 0 then for _, npc in ipairs(otherDead) do local tryParts = getValidParts(npc) if #tryParts > 0 then targetNpc = npc parts = tryParts break end end end if targetNpc then print("Trying to eat:", targetNpc and targetNpc.Name) if #parts > 0 then local bodyPart = parts[math.random(1, #parts)] local origin = Camera.CFrame.Position local targetPos = bodyPart.Position + Vector3.new( math.random(-15, 15) / 10, math.random(-15, 15) / 10, math.random(-15, 15) / 10 ) local dir = (targetPos - origin).Unit if dir.Magnitude ~= dir.Magnitude then dir = Camera.CFrame.LookVector end remote:FireServer({ ["AN"] = "Eat", ["D"] = dir, ["O"] = origin, ["FBP"] = bodyPart }) if not guiHovered then VirtualInputManager:SendMouseButtonEvent(ViewportSize.X/2, ViewportSize.Y/2, 0, true, game, 0) VirtualInputManager:SendMouseButtonEvent(ViewportSize.X/2, ViewportSize.Y/2, 0, false, game, 0) end end end -- Existing Shoot logic (unchanged) local target = getClosestAliveNPC() if target then local bodyPart = target:FindFirstChild("HumanoidRootPart") or target:FindFirstChildWhichIsA("BasePart") if bodyPart then local origin = Camera.CFrame.Position local dir = (bodyPart.Position - origin).Unit if dir.Magnitude ~= dir.Magnitude then dir = Camera.CFrame.LookVector end remote:FireServer({ ["AN"] = "Shoot", ["D"] = dir, ["O"] = origin, ["FBP"] = bodyPart }) if not guiHovered then VirtualInputManager:SendMouseButtonEvent(ViewportSize.X/2, ViewportSize.Y/2, 0, true, game, 0) VirtualInputManager:SendMouseButtonEvent(ViewportSize.X/2, ViewportSize.Y/2, 0, false, game, 0) end end end end end) local function noclipCharacter() local character = LocalPlayer.Character if character then for _, part in ipairs(character:GetDescendants()) do if part:IsA("BasePart") and part.CanCollide then part.CanCollide = false end end end end local function removeAllChairs() for _, obj in ipairs(Workspace:GetDescendants()) do if obj:IsA("Seat") or obj:IsA("VehicleSeat") then obj:Destroy() end end end removeAllChairs() task.spawn(function() while true do task.wait(5) removeAllChairs() end end) local lastReset = 0 local resetCooldown = 120 local function checkAndResetPosition(character) local hrp = character and character:FindFirstChild("HumanoidRootPart") if hrp then if hrp.Position.Y > 100 or hrp.Position.Y < -20 or math.abs(hrp.Position.X) > 500 or math.abs(hrp.Position.Z) > 500 then if tick() - lastReset > resetCooldown then lastReset = tick() hrp.CFrame = CFrame.new(Vector3.new(0, 10, 0)) warn("Character reset to safe position") end end end end local lastAutoResetTime = tick() task.spawn(function() while true do task.wait(1) local character = LocalPlayer.Character if not character then continue end if tick() - lastAutoResetTime > 180 then lastAutoResetTime = tick() local hrp = character:FindFirstChild("HumanoidRootPart") if hrp then hrp.CFrame = CFrame.new(Vector3.new(0, 10, 0)) warn("Auto-reset character to safe position") end end end end) task.spawn(function() while true do task.wait(0.5) local character = LocalPlayer.Character if not character then continue end checkAndResetPosition(character) local hrp = character:FindFirstChild("HumanoidRootPart") local humanoid = character:FindFirstChildWhichIsA("Humanoid") if not hrp or not humanoid then continue end noclipCharacter() if autoWalkEnabled then local closestNPC = getClosestAliveNPC() if not closestNPC then continue end local npcHRP = closestNPC:FindFirstChild("HumanoidRootPart") if not npcHRP then continue end local offset = Vector3.new(3, 0, 3) local goalPosition = npcHRP.Position + offset if (hrp.Position - goalPosition).Magnitude > 3 then humanoid:MoveTo(goalPosition) local reached = false local conn conn = humanoid.MoveToFinished:Connect(function(success) reached = true conn:Disconnect() end) task.delay(3, function() if not reached and conn then conn:Disconnect() end end) end end end end) -- GUI creation local function createControlGui() local existing = LocalPlayer:WaitForChild("PlayerGui"):FindFirstChild("ControlGui") if existing then existing:Destroy() end local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "ControlGui" ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui") local function createToggleButton(name, position, initialState, callback) local button = Instance.new("TextButton") button.Size = UDim2.new(0, 200, 0, 40) button.Position = position button.Text = name .. ": " .. (initialState and "ON" or "OFF") button.BackgroundColor3 = initialState and Color3.fromRGB(191,0,255) or Color3.fromRGB(200, 0, 0) button.TextColor3 = Color3.fromRGB(255, 255, 255) button.Parent = ScreenGui button.Font = Enum.Font.SourceSansBold button.TextSize = 24 button.MouseEnter:Connect(function() guiHovered = true end) button.MouseLeave:Connect(function() guiHovered = false end) button.MouseButton1Click:Connect(function() initialState = not initialState button.Text = name .. ": " .. (initialState and "ON" or "OFF") button.BackgroundColor3 = initialState and Color3.fromRGB(76,40,130) or Color3.fromRGB(200, 0, 0) callback(initialState) end) end -- Toggles local baseYOffset = -60 local spacing = 60 createToggleButton("Auto Eat/Shoot", UDim2.new(0, 20, 0.5, baseYOffset), autoEatShoot, function(state) autoEatShoot = state end) createToggleButton("Auto Walk", UDim2.new(0, 20, 0.5, baseYOffset + spacing), autoWalkEnabled, function(state) autoWalkEnabled = state end) -- Dropdown for weapon selection local dropdownButton = Instance.new("TextButton") dropdownButton.Size = UDim2.new(0, 200, 0, 40) dropdownButton.Position = UDim2.new(0, 20, 0.5, baseYOffset + spacing * 2) -- aligned with middle-left dropdownButton.AnchorPoint = Vector2.new(0, 0.5) dropdownButton.Text = "Weapon: " .. selectedWeapon dropdownButton.BackgroundColor3 = Color3.fromRGB(76, 40, 130) dropdownButton.TextColor3 = Color3.new(1, 1, 1) dropdownButton.Font = Enum.Font.SourceSansBold dropdownButton.TextSize = 20 dropdownButton.Parent = ScreenGui local dropdownFrame = Instance.new("Frame") dropdownFrame.Size = UDim2.new(0, 200, 0, 0) dropdownFrame.Position = UDim2.new(0, 20, 0.5, baseYOffset + 140) dropdownFrame.AnchorPoint = Vector2.new(0, 0) dropdownFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 70) dropdownFrame.ClipsDescendants = true dropdownFrame.Parent = ScreenGui local options = {"King Slayer", "Classic Sword"} for i, option in ipairs(options) do local optionBtn = Instance.new("TextButton") optionBtn.Size = UDim2.new(1, 0, 0, 30) optionBtn.Position = UDim2.new(0, 0, 0, (i - 1) * 30) optionBtn.Text = option optionBtn.BackgroundColor3 = Color3.fromRGB(100, 100, 140) optionBtn.TextColor3 = Color3.new(1,1,1) optionBtn.Font = Enum.Font.SourceSans optionBtn.TextSize = 18 optionBtn.Parent = dropdownFrame optionBtn.MouseButton1Click:Connect(function() selectedWeapon = option dropdownButton.Text = "Weapon: " .. selectedWeapon dropdownFrame:TweenSize(UDim2.new(0, 200, 0, 0), "Out", "Quad", 0.3, true) equipSelectedWeapon() end) end local expanded = false dropdownButton.MouseButton1Click:Connect(function() if expanded then dropdownFrame:TweenSize(UDim2.new(0, 200, 0, 0), "Out", "Quad", 0.3, true) expanded = false else dropdownFrame:TweenSize(UDim2.new(0, 200, 0, #options * 30), "Out", "Quad", 0.3, true) expanded = true end end) end LocalPlayer.CharacterAdded:Connect(function() task.wait(1) equipSelectedWeapon() createControlGui() end) createControlGui()