getgenv().weapon = "Combat"

getgenv().farm = true

-- variables
local runs = game:GetService("RunService");
local tweens = game:GetService("TweenService");
local VirtualUser = game:GetService("VirtualUser")
local VirtualInputManager = game:GetService("VirtualInputManager");
local TeleportService = game:GetService("TeleportService");
local Ip = game:GetService("Players").LocalPlayer;
local character = Ip.Character or Ip.CharacterAdded:Wait();
local humanoidRootPart = character:WaitForChild("HumanoidRootPart");
local tweeninfo = TweenInfo.new(1, Enum.EasingStyle.Linear);
local Humanoid = character:WaitForChild("Humanoid");
local UserInputService = game:GetService("UserInputService");
local http = game:GetService("HttpService");
local ReplicatedStorage = game:GetService("ReplicatedStorage");
local island = {
    starterIsland = CFrame.new(-2044.22327, 100.1203, -4591.66895, 0.995279193, 2.47419951e-08, -0.0970530137, -2.49532022e-08, 1, -9.62440905e-10, 0.0970530137, 3.37968098e-09, 0.995279193),
    pirateIsland = CFrame.new(-681.310913, 64.7008209, -3449.32129, 0.431197256, -1.00678399e-07, -0.902257681, -7.38692232e-11, 1, -1.11620274e-07, 0.902257681, 4.81970055e-08, 0.431197256)
}
local function tween(v, speed)
    if character and humanoidRootPart then
        local cf = CFrame.new(v)
        local distance = (humanoidRootPart.Position - v).Magnitude
        local time = distance / speed
        local tweeninfo = TweenInfo.new(time, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
        local start_tween = tweens:Create(humanoidRootPart, tweeninfo, {
            CFrame = cf
        });
        start_tween:Play();
        return start_tween;
    end
end

local questDes,questEnemy,questIsland

local function checkQuest()
    questDes = nil
    questEnemy = nil
    questIsland = nil
    local level = tonumber(Ip.PlayerStats.lvl.Value)
    if level < 10 then
        questDes = "Kill 4 Soldiers"
        questEnemy = "Soldier [Lv.1]"
        questIsland = island.starterIsland
    elseif level >= 10 and level < 20 then
        questDes = "Kill 5 Clown Pirates"
        questEnemy = "Clown Pirate [Lv.10]"
        questIsland = island.starterIsland
    elseif level >= 20 and level < 30 then
        questDes = "Kill 1 Smoky"
        questEnemy = "Smoky [Lv.20]"
        questIsland = island.starterIsland
    elseif level >= 30 and level < 50 then
        questDes = "Kill 1 Tashi"
        questEnemy = "Tashi [Lv.30]"
        questIsland = island.starterIsland
    elseif level >= 50 and level < 75 then
        questDes = "Kill 6 Clown Swordman"
        questEnemy = "Clown Swordman [Lv.50]"
        questIsland = island.pirateIsland
    elseif level >= 75 and level < 100 then
        questDes = "Kill 1 The Clown"
        questEnemy = "The Clown [Lv.75]"
        questIsland = island.pirateIsland
    end
end

Ip.CharacterAdded:Connect(function()
    character = Ip.Character or Ip.CharacterAdded:Wait()
    humanoidRootPart = character:WaitForChild("HumanoidRootPart")
end)

runs.Heartbeat:Connect(function()
    if character and character:FindFirstChild("Humanoid") and getgenv().farm then
        local humanoid = character.Humanoid
        if humanoid:GetState() == Enum.HumanoidStateType.Freefall then
            character.HumanoidRootPart.Velocity = Vector3.new(0, -0.01, 0)
        end
    end
end)

-- select weapon

if getgenv().weapon == "Combat" then
    getgenv().weapon = "None"
end

-- auto farm

spawn(function()
    while getgenv().farm and wait(0.1) do
        local backpack = game:GetService("Players").LocalPlayer.Backpack
        if backpack[getgenv().weapon] then
            character.Humanoid:EquipTool(backpack[getgenv().weapon])
        end
        checkQuest()
        if #Ip.CurrentQuest.Value < 1 or Ip.CurrentQuest.Value ~=questDes then
            local args = {[1] = "take", [2] = questDes}
            ReplicatedStorage:WaitForChild("Chest"):WaitForChild("Functions"):WaitForChild("Quest"):InvokeServer(unpack(args))
        end
        local npc
        repeat
            if workspace.Monster.Boss[questEnemy] then
                npc = workspace.Monster.Boss:WaitForChild(questEnemy)
            else
                npc = workspace.Monster.Mon:WaitForChild(questEnemy)
            end
            wait(0.1)
        until npc and npc:FindFirstChild("HumanoidRootPart") and npc.Humanoid.Health > 0
        if humanoidRootPart and npc and npc:FindFirstChild("HumanoidRootPart") and npc.Humanoid.Health > 0 then
            tween(Vector3.new(npc.HumanoidRootPart.Position.X, npc.HumanoidRootPart.Position.Y + 4, npc.HumanoidRootPart.Position.Z), 10000)
            VirtualInputManager:SendMouseButtonEvent(0, 0, 0, true, game, 0)
            VirtualInputManager:SendMouseButtonEvent(0, 0, 0, false, game, 0)
        else
            repeat checkQuest() wait(1) until workspace.Monster.Boss[questEnemy]
        end
    end
end)

Embed on website

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