-- Auto Farm Toggle Integration

local Players, TweenService = game:GetService("Players"), game:GetService("TweenService")
local player, character = Players.LocalPlayer, (Players.LocalPlayer.Character or Players.LocalPlayer.CharacterAdded:Wait())
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")

local function findNPC(name)
    local npc = game.Workspace:FindFirstChild(name, true)
    local primaryPart = npc and (npc.PrimaryPart or npc:FindFirstChild("HumanoidRootPart") or npc:FindFirstChildWhichIsA("Part"))
    return primaryPart and primaryPart.CFrame.Position, npc
end

local function getClosestNPCPosition(playerPosition, npcNames)
    local closestDistance, closestNPCPosition, closestNPC = math.huge, nil, nil

    for _, npcName in ipairs(npcNames) do
        local npcPosition, npc = findNPC(npcName)
        if npcPosition then
            local distance = (npcPosition - playerPosition).Magnitude
            if distance < closestDistance then
                closestDistance, closestNPCPosition, closestNPC = distance, npcPosition, npc
            end
        else
            warn("NPC not found:", npcName)
        end
    end

    return closestNPCPosition, closestNPC
end

local function fireSkill(key, args)
    args[2] = key
    game:GetService("Players").LocalPlayer.Character.Remotes.KeyEvent:FireServer(unpack(args))
end

local npcLists = {
    {"First Class Investigator", "Rank 1 Investigator", "Rank 2 Investigator", "Rank 3 Investigator"},
    {"High Rank Aogiri Member", "Med Rank Aogiri Member", "Low Rank Aogiri Member"},
    {"Human", "Athlete"}
}

local allNPCNames = {}
for _, npcList in ipairs(npcLists) do
    table.move(npcList, 1, #npcList, #allNPCNames + 1, allNPCNames)
end

local keysToFire = {"E", "F", "G", "C", "R", "Mouse1"}

local AutoFarmEnabled = false -- Variable to track Auto Farm state

-- Auto Farm Toggle UI Integration

local OrionLib = loadstring(game:HttpGet(('https://[Log in to view URL]')))()

local Window = OrionLib:MakeWindow({Name = "Ro Ghoul", HidePremium = false,IntroText = "Welcome" , SaveConfig = false, ConfigFolder = "AE Hub"})

local MainTab = Window:MakeTab({
    Name = "Main",
    Icon = "rbxassetid://14554241836",
    PremiumOnly = false
})

MainTab:AddButton({
    Name = "Op Dash",
    Callback = function()
        loadstring(game:HttpGet("https://[Log in to view URL]"))()
    end    
})

MainTab:AddToggle({
    Name = "Auto Farm",
    Default = false,
    Callback = function(Value)
        AutoFarmEnabled = Value -- Update Auto Farm state
    end    
})

while true do
    if AutoFarmEnabled then
        local playerPosition = humanoidRootPart.Position
        local closestNPCPosition, closestNPC = getClosestNPCPosition(playerPosition, allNPCNames)

        if closestNPCPosition then
            -- Your existing logic for moving towards NPCs and firing skills

            local targetPosition, mainTweenInfo = closestNPCPosition, TweenInfo.new((closestNPCPosition - humanoidRootPart.Position).Magnitude / 200, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
            local mainTween = TweenService:Create(humanoidRootPart, mainTweenInfo, {CFrame = CFrame.new(targetPosition)})
            mainTween:Play()

            mainTween.Completed:Wait() -- Wait for the main tween to complete

            -- Sticking tween
            local stickingTweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0.1)
            local stickingTween = TweenService:Create(humanoidRootPart, stickingTweenInfo, {CFrame = CFrame.new(targetPosition)})
            stickingTween:Play()

            stickingTween.Completed:Wait() -- Wait for the sticking tween to complete

            -- Fire skills
            local args = {
                [1] = "\230\147\141\228\189\160\240\159\146\166\240\159\146\148\240\159\141\145\240\159\145\140\240\159\146\166\230\147\141\228\189\160\240\159\146\166\240\159\146\148\240\159\141\145\240\159\145\140\240\159\146\166\240\159\146\148\240\159\141\145\240\159\145\140\240\159\146\166\240\159\146\148\240\159\141\145\240\159\145\140\240\159\146\148\240\159\141\145\240\159\145\140\240\159\146\166\240\159\146\148\240\159\141\145\240\159\145\140",
                [3] = "Down",
                [4] = CFrame.new(-1608.6644287109375, 60.999732971191406, 554.9979248046875) * CFrame.Angles(-2.2716362476348877, -0.4735432267189026, -2.646064043045044),
                [6] = CFrame.new(-1615.213134765625, 70.76848602294922, 546.7559204101562) * CFrame.Angles(-2.7268407344818115, 0.0852203443646431, 3.1041336059570312),
                [7] = Vector3.new(-1709.463134765625, 65.7551040649414, -323.7388916015625)
            }

            for _, key in ipairs(keysToFire) do
                fireSkill(key, args)
            end
        else
            warn("No valid NPCs found.")
            wait(5) -- Wait before searching for NPCs again
        end
    end

    wait(1) -- Adjust this wait time as needed
end

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: