-- GUARD: prevent double execution if _G.KNIFE_FARM_LOADED then return end _G.KNIFE_FARM_LOADED = true --[[ Universal Knife Farm — Free Executor Compatible Author: probeta DESCRIPTION: Automates knife farming in any Roblox knife-fighting or collecting game. Features: - Auto Swing: Automatically swings your equipped knife/tool. - Auto Collect: Picks up dropped coins, gems, items, orbs within range. - Auto Sell: Sells items via remote events or by touching sell pads. - Auto Equip: Takes a tool from your backpack if none is equipped. Works on all free executors: JJSploit, Krnl, Fluxus, Solara, Delta, Arceus X, etc. No external libraries. Fully toggleable GUI. Touch simulation with fallbacks. HOW TO USE: 1. Execute script while in a Roblox game that involves knife farming. 2. A draggable GUI will appear on screen. 3. Toggle features ON/OFF as needed. 4. Watch your character automatically farm, collect, and sell. NOTE: If drops or sell pads have different names in your game, edit the CFG table (dropFolders, sellRemotes, sellPads) near line 70. ]] ---------------------------------------------------------------------- -- COMPATIBILITY LAYER ---------------------------------------------------------------------- if not task then task = { spawn = function(f) coroutine.wrap(f)() end, wait = function(n) return wait(n or 0) end, delay = function(t, f) delay(t, f) end, } end local function safeSpawn(f) task.spawn(function() local ok, err = pcall(f) if not ok then warn("[KnifeFarm] Thread died: " .. tostring(err)) end end) end local HAS_FIRETOUCHINTEREST = (typeof(firetouchinterest) == "function") if not HAS_FIRETOUCHINTEREST then if typeof(touchinterest) == "function" then firetouchinterest = touchinterest HAS_FIRETOUCHINTEREST = true end end local HAS_MOUSE_CLICK = typeof(mouse1press) == "function" and typeof(mouse1release) == "function" ---------------------------------------------------------------------- -- SERVICES ---------------------------------------------------------------------- local Players = game:GetService("Players") local Workspace = game:GetService("Workspace") local ReplicatedStorage = game:GetService("ReplicatedStorage") local LocalPlayer = Players.LocalPlayer local Mouse = LocalPlayer:GetMouse() local Character, HumanoidRootPart, Humanoid local function refreshCharacter() Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait() HumanoidRootPart = Character:WaitForChild("HumanoidRootPart", 10) Humanoid = Character:WaitForChild("Humanoid", 10) end refreshCharacter() LocalPlayer.CharacterAdded:Connect(function(char) Character = char HumanoidRootPart = char:WaitForChild("HumanoidRootPart", 10) Humanoid = char:WaitForChild("Humanoid", 10) end) ---------------------------------------------------------------------- -- CONFIG (edit these if your game uses different names) ---------------------------------------------------------------------- local CFG = { autoSwing = true, autoCollect = true, autoSell = true, autoEquip = true, swingDelay = 0.08, collectDelay = 0.6, sellDelay = 6, dropFolders = {"Drops", "Coins", "Gems", "Items", "Collectibles", "KnifeDrops", "Orbs"}, sellRemotes = {"Sell", "SellAll", "SellKnives", "SellItems", "sell", "sellAll"}, sellPads = {"SellPad", "SellRing", "SellPart", "SellZone", "Sell", "SellArea"}, } ---------------------------------------------------------------------- -- GUI (draggable, toggleable, closable) ---------------------------------------------------------------------- local function createGUI() while not LocalPlayer do wait(0.1) end local playerGui = LocalPlayer:FindFirstChild("PlayerGui") if not playerGui then playerGui = LocalPlayer:WaitForChild("PlayerGui", 10) if not playerGui then return end end local oldGui = playerGui:FindFirstChild("KnifeFarmGUI") if oldGui then oldGui:Destroy() end local screenGui = Instance.new("ScreenGui") screenGui.Name = "KnifeFarmGUI" screenGui.ResetOnSpawn = false screenGui.Parent = playerGui local mainFrame = Instance.new("Frame") mainFrame.Size = UDim2.new(0, 220, 0, 200) mainFrame.Position = UDim2.new(0.5, -110, 0.5, -100) mainFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 45) mainFrame.BorderSizePixel = 0 mainFrame.ClipsDescendants = true mainFrame.Draggable = true mainFrame.Active = true mainFrame.Parent = screenGui local title = Instance.new("TextLabel") title.Size = UDim2.new(1, 0, 0, 30) title.Text = "Knife Farm" title.TextColor3 = Color3.fromRGB(255, 200, 100) title.BackgroundColor3 = Color3.fromRGB(30, 30, 35) title.BorderSizePixel = 0 title.Font = Enum.Font.GothamBold title.TextSize = 16 title.Parent = mainFrame local closeBtn = Instance.new("TextButton") closeBtn.Size = UDim2.new(0, 30, 0, 30) closeBtn.Position = UDim2.new(1, -30, 0, 0) closeBtn.Text = "X" closeBtn.TextColor3 = Color3.fromRGB(255, 255, 255) closeBtn.BackgroundColor3 = Color3.fromRGB(150, 0, 0) closeBtn.BorderSizePixel = 0 closeBtn.Parent = mainFrame closeBtn.MouseButton1Click:Connect(function() screenGui.Enabled = not screenGui.Enabled end) local function addToggle(text, cfgKey, yPos) local btn = Instance.new("TextButton") btn.Size = UDim2.new(0.9, 0, 0, 30) btn.Position = UDim2.new(0.05, 0, 0, yPos) btn.Text = text .. ": " .. (CFG[cfgKey] and "ON" or "OFF") btn.BackgroundColor3 = CFG[cfgKey] and Color3.fromRGB(0, 150, 0) or Color3.fromRGB(80, 80, 90) btn.BorderSizePixel = 0 btn.TextColor3 = Color3.fromRGB(255, 255, 255) btn.Parent = mainFrame btn.MouseButton1Click:Connect(function() CFG[cfgKey] = not CFG[cfgKey] btn.Text = text .. ": " .. (CFG[cfgKey] and "ON" or "OFF") btn.BackgroundColor3 = CFG[cfgKey] and Color3.fromRGB(0, 150, 0) or Color3.fromRGB(80, 80, 90) end) end addToggle("Auto Swing", "autoSwing", 40) addToggle("Auto Collect", "autoCollect", 75) addToggle("Auto Sell", "autoSell", 110) addToggle("Auto Equip", "autoEquip", 145) local statusLabel = Instance.new("TextLabel") statusLabel.Size = UDim2.new(1, 0, 0, 20) statusLabel.Position = UDim2.new(0, 0, 1, -20) statusLabel.Text = "Status: Running" statusLabel.TextColor3 = Color3.fromRGB(150, 255, 150) statusLabel.BackgroundTransparency = 1 statusLabel.TextSize = 12 statusLabel.Parent = mainFrame end pcall(createGUI) task.spawn(function() wait(1) pcall(createGUI) end) ---------------------------------------------------------------------- -- UTILITIES ---------------------------------------------------------------------- local function safeFind(parent, name) if parent and typeof(parent) == "Instance" then local ok, result = pcall(function() return parent:FindFirstChild(name) end) if ok then return result end end return nil end local function findAny(parent, names) for _, name in ipairs(names) do local found = safeFind(parent, name) if found then return found end end return nil end local function findAnyRecursive(parent, names, maxDepth) maxDepth = maxDepth or 3 if maxDepth <= 0 then return nil end for _, child in ipairs(parent:GetChildren()) do for _, name in ipairs(names) do if child.Name == name then return child end end local deeper = findAnyRecursive(child, names, maxDepth - 1) if deeper then return deeper end end return nil end ---------------------------------------------------------------------- -- KNIFE EQUIP ---------------------------------------------------------------------- local function getKnife() if not Character then return nil end for _, obj in ipairs(Character:GetChildren()) do if obj:IsA("Tool") then return obj end end if CFG.autoEquip and LocalPlayer.Backpack then for _, obj in ipairs(LocalPlayer.Backpack:GetChildren()) do if obj:IsA("Tool") then obj.Parent = Character task.wait(0.1) return obj end end end return nil end ---------------------------------------------------------------------- -- TOUCH SIMULATION ---------------------------------------------------------------------- local function touchPart(part) if not HumanoidRootPart or not part then return end if not part:IsA("BasePart") then return end if HAS_FIRETOUCHINTEREST then pcall(function() firetouchinterest(HumanoidRootPart, part, 0) task.wait() firetouchinterest(HumanoidRootPart, part, 1) end) else pcall(function() local saved = HumanoidRootPart.CFrame HumanoidRootPart.CFrame = part.CFrame task.wait(0.15) HumanoidRootPart.CFrame = saved end) end end local function manualClick() if HAS_MOUSE_CLICK then pcall(function() mouse1press() task.wait(0.02) mouse1release() end) else local target = Mouse.Target if target then local click = target:FindFirstChildWhichIsA("ClickDetector") if click then pcall(function() fireclickdetector(click) end) end end end end ---------------------------------------------------------------------- -- AUTO SWING THREAD ---------------------------------------------------------------------- safeSpawn(function() while true do task.wait(CFG.swingDelay) if not CFG.autoSwing then continue end if not Character or not HumanoidRootPart then refreshCharacter() continue end local knife = getKnife() if not knife then manualClick() continue end pcall(function() knife:Activate() end) pcall(function() for _, v in ipairs(knife:GetDescendants()) do if v:IsA("RemoteEvent") then v:FireServer() end if v:IsA("RemoteFunction") then pcall(function() v:InvokeServer() end) end end end) pcall(function() local click = knife:FindFirstChildWhichIsA("ClickDetector") if click then fireclickdetector(click) end end) manualClick() end end) ---------------------------------------------------------------------- -- AUTO COLLECT THREAD ---------------------------------------------------------------------- safeSpawn(function() while true do task.wait(CFG.collectDelay) if not CFG.autoCollect then continue end if not Character or not HumanoidRootPart then refreshCharacter() continue end local dropsFolder = findAny(Workspace, CFG.dropFolders) local targets = {} if dropsFolder then for _, drop in ipairs(dropsFolder:GetChildren()) do if drop:IsA("BasePart") or drop:IsA("Model") then table.insert(targets, drop) end end if #targets == 0 and dropsFolder:IsA("BasePart") then table.insert(targets, dropsFolder) end else local rootPos = HumanoidRootPart.Position for _, obj in ipairs(Workspace:GetDescendants()) do if obj:IsA("BasePart") then local name = obj.Name:lower() if name:find("coin") or name:find("gem") or name:find("drop") or name:find("orb") then if (obj.Position - rootPos).Magnitude < 50 then table.insert(targets, obj) end end end end end for _, target in ipairs(targets) do local part = target if target:IsA("Model") then part = target:FindFirstChildWhichIsA("BasePart") end if part then touchPart(part) end if #targets > 5 then task.wait(0.1) end end end end) ---------------------------------------------------------------------- -- AUTO SELL THREAD ---------------------------------------------------------------------- safeSpawn(function() while true do task.wait(CFG.sellDelay) if not CFG.autoSell then continue end if not Character or not HumanoidRootPart then refreshCharacter() continue end local sold = false local containers = {ReplicatedStorage} local remoteFolder = safeFind(ReplicatedStorage, "Remotes") or safeFind(ReplicatedStorage, "Events") or safeFind(ReplicatedStorage, "RemoteEvents") if remoteFolder then table.insert(containers, remoteFolder) end for _, container in ipairs(containers) do for _, name in ipairs(CFG.sellRemotes) do local remote = safeFind(container, name) if remote then if remote:IsA("RemoteEvent") then pcall(function() remote:FireServer() end) sold = true elseif remote:IsA("RemoteFunction") then pcall(function() remote:InvokeServer() end) sold = true end end end end if not sold then local pad = findAny(Workspace, CFG.sellPads) or findAnyRecursive(Workspace, CFG.sellPads, 2) if pad then local part = pad if pad:IsA("Model") then part = pad:FindFirstChildWhichIsA("BasePart") end if part and part:IsA("BasePart") then touchPart(part) end end end end end) ---------------------------------------------------------------------- -- ANTI-AFK & ANTI-FALL ---------------------------------------------------------------------- safeSpawn(function() local VirtualUser = game:GetService("VirtualUser") LocalPlayer.Idled:Connect(function() pcall(function() if VirtualUser then VirtualUser:CaptureController() VirtualUser:ClickButton2(Vector2.new()) else local oldPos = Vector2.new(Mouse.X, Mouse.Y) Mouse.Move(oldPos.X + 1, oldPos.Y) task.wait(0.1) Mouse.Move(oldPos.X, oldPos.Y) end end) end) end) safeSpawn(function() while true do task.wait(2) if HumanoidRootPart and HumanoidRootPart.Position.Y < -150 then pcall(function() HumanoidRootPart.CFrame = CFrame.new(0, 50, 0) end) end end end) ---------------------------------------------------------------------- -- INIT ---------------------------------------------------------------------- print("[KnifeFarm] Loaded successfully. GUI is on screen. All features are toggleable.") print("[KnifeFarm] If drops/sell pads aren't detected, edit CFG table at the top.")