local Players = game:GetService("Players") local Workspace = game:GetService("Workspace") local RunService = game:GetService("RunService") local LocalPlayer = Players.LocalPlayer local Rayfield = loadstring(game:HttpGet("https://sirius.menu/rayfield"))() local Window = Rayfield:CreateWindow({ Name = "Auto Farm", LoadingTitle = "Enemy Farm", LoadingSubtitle = "by you", ConfigurationSaving = { Enabled = false } }) local Tab = Window:CreateTab("Farm") local selectedEnemy = nil local autoFarm = false local function GetEnemyNames() local names = {} local seen = {} for _,enemy in pairs(workspace.Enemies:GetChildren()) do if not seen[enemy.Name] then table.insert(names, enemy.Name) seen[enemy.Name] = true end end return names end local function TeleportToEnemy(enemy) local char = LocalPlayer.Character if not char then return end local root = char:FindFirstChild("HumanoidRootPart") local target = enemy:FindFirstChild("HumanoidRootPart") or enemy:FindFirstChild("Torso") if root and target then if (root.Position - target.Position).Magnitude > 5 then root.CFrame = target.CFrame + Vector3.new(0,2,0) end end end local function Attack() local char = LocalPlayer.Character if not char then return end local tool = char:FindFirstChildOfClass("Tool") if not tool then return end local remote = tool:FindFirstChild("Remotes") if remote then local click = remote:FindFirstChild("Click") if click then for i = 1,3 do click:FireServer() end end end end task.spawn(function() while true do if autoFarm and selectedEnemy then for _,enemy in pairs(workspace.Enemies:GetChildren()) do if enemy.Name == selectedEnemy then local humanoid = enemy:FindFirstChildOfClass("Humanoid") if humanoid and humanoid.Health > 0 then TeleportToEnemy(enemy) Attack() task.wait(0.15) end end end end task.wait(0.1) end end) Tab:CreateDropdown({ Name = "Select Enemy", Options = GetEnemyNames(), CurrentOption = {}, Callback = function(option) selectedEnemy = option[1] end }) Tab:CreateToggle({ Name = "Auto Farm", CurrentValue = false, Callback = function(state) autoFarm = state end })