Auto-farm with Enemy Name Detection
_G.IfYouAreFarming = true local client = game.Players.LocalPlayer pcall(function() local wantedEnemy = "White Suit" local function getEnemyName(nepc) if not nepc:FindFirstChild("VisualName") then return false end local enemyName = string.split(nepc.VisualName.Value:lower(), " (")[1] if enemyName == wantedEnemy:lower() then return true end return false end game:GetService('RunService').Stepped:connect(function() pcall(function() if _G.IfYouAreFarming then if client.Character and client.Character:FindFirstChildOfClass("Humanoid") then client.Character:findFirstChildOfClass("Humanoid"):ChangeState(11) for _, yes in pairs(client.Character:GetDescendants()) do if yes:IsA("BasePart") then yes.Massless = true end end end end end) end) spawn(function() while _G.IfYouAreFarming and task.wait() do if client.Character then local distance = math.huge for _, v in pairs(game:GetService("Workspace").NPCs.Alive:GetChildren()) do if getEnemyName(v) then pcall(function() if v:FindFirstChild"HumanoidRootPart" and v:FindFirstChild"Humanoid" then if v.Humanoid.Health > 0 then local distanceFromChar = (client.Character.HumanoidRootPart.Position - v.HumanoidRootPart.Position).Magnitude if distanceFromChar 0 then client.Character.Humanoid:ChangeState(3) local speed = (client.Character.HumanoidRootPart.Position - v.HumanoidRootPart.Position).Magnitude / 250 game:GetService"TweenService":Create(client.Character.HumanoidRootPart, TweenInfo.new(speed, Enum.EasingStyle.Linear), { CFrame = v.HumanoidRootPart.CFrame * CFrame.new(0, 0, 8) }):Play() game:GetService("VirtualUser"):ClickButton1(Vector2.new(0,0)) end end end until _G.IfYouAreFarming == false or v.Humanoid.Health <= 0 end end end end) end end end end end) end)