local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local HttpService = game:GetService("HttpService")
local TeleportService = game:GetService("TeleportService")
local RunService = game:GetService("RunService") -- Added this to fix the error
local LocalPlayer = Players.LocalPlayer

-- Essential Variables for the Tracker
local username = LocalPlayer.Name
local userid = tostring(LocalPlayer.UserId)
local requestFunc = syn and syn.request or http_request or request or (http and http.request) or HttpService.request
local apiBase = "http://[Log in to view URL]"

-- [ UI LIBRARY SETUP ]
local Library = loadstring(game:HttpGetAsync("https://[Log in to view URL]"))()

local Window = Library:Window({
    Title = "NWR's Hub | [🎄] Anime Fighting Simulator: Endless",
    SubTitle = "by whoisnwr",
    TabWidth = 160, Size = UDim2.fromOffset(580, 520),
    Acrylic = true, Theme = "Darker",
})

local Tabs = { 
    Main = Window:AddTab({ Title = "Auto Farm", Icon = "target" }),
    Player = Window:AddTab({ Title = "Player", Icon = "user" }),
    Settings = Window:AddTab({ Title = "Settings", Icon = "settings" })
}

---------------------------------------------------------
-- USER TRACKING & DISCORD LOGIC
---------------------------------------------------------
local usercountsection = Tabs.Settings:AddSection("User Management")
local userCountParagraph = Tabs.Settings:AddParagraph("UserCountStatus", {
    Title = "Script User Count",
    Content = "Connecting to API..."
})

local function sendDiscordUpdate(activeCount, totalCount)
    local proxyURL = "https://[Log in to view URL]"
    
    local data = {
        ["embeds"] = {{
            ["title"] = "📊 Anime Fighting Sim Live Stats",
            ["description"] = "Real-time user tracking updated.",
            ["color"] = 65535,
            ["fields"] = {
                {["name"] = "Active Now", ["value"] = "👤 **" .. tostring(activeCount) .. "**", ["inline"] = true},
                {["name"] = "Total Users", ["value"] = "🌎 " .. tostring(totalCount), ["inline"] = true}
            },
            ["footer"] = {["text"] = "Server: " .. game.JobId},
            ["timestamp"] = DateTime.now():ToIsoDate()
        }}
    }

    pcall(function()
        requestFunc({
            Url = proxyURL,
            Method = "POST",
            Headers = { ["Content-Type"] = "application/json", ["User-Agent"] = "Roblox/Linux" },
            Body = HttpService:JSONEncode(data)
        })
    end)
end

task.spawn(function()
    pcall(function()
        requestFunc({
            Url = apiBase .. "/add-user",
            Method = "POST",
            Headers = {["Content-Type"] = "application/json"},
            Body = HttpService:JSONEncode({username = username, userid = userid})
        })
    end)

    while true do
        local success, response = pcall(function()
            return requestFunc({
                Url = apiBase .. "/tapsim/active",
                Method = "POST",
                Headers = {["Content-Type"] = "application/json"},
                Body = HttpService:JSONEncode({userid = userid, active = true})
            })
        end)

        if success and response and response.Body then
            local decodeSuccess, data = pcall(function() return HttpService:JSONDecode(response.Body) end)
            if decodeSuccess and data and data.active_count ~= nil then
                userCountParagraph:SetValue("Total users: " .. data.count .. "\nActive Users: " .. data.active_count)
                sendDiscordUpdate(data.active_count, data.count)
            else
                userCountParagraph:SetValue("⚠️ Error: Invalid Server Response")
            end
        else
            userCountParagraph:SetValue("⚠️ Error: API Offline")
        end
        task.wait(30)
    end
end)

---------------------------------------------------------
-- GAME LOGIC
---------------------------------------------------------
local Config = {
    AutoFarm = false, AutoTP = false, SelectedStat = 1, SelectedZoneID = 1,
    SelectedCFrame = CFrame.new(-5.57, 65.21, 132.44), WalkSpeed = 16,
    JumpPower = 50, InfiniteJump = false, AutoClaimChikara = false
}

local Zones = {
    Strength = { ID = 1,
        ["Zone 1"] = {ID = 1, CF = CFrame.new(-5.57, 65.21, 132.44)},
        ["Zone 2"] = {ID = 2, CF = CFrame.new(1337.87, 153.96, -146.97)},
        ["Zone 3"] = {ID = 3, CF = CFrame.new(-1251.32, 59.00, 475.41)},
        ["Zone 4"] = {ID = 4, CF = CFrame.new(-917.36, 83.36, 163.62)},
        ["Zone 5"] = {ID = 5, CF = CFrame.new(-2241.72, 617.96, 523.75)},
        ["Zone 6"] = {ID = 6, CF = CFrame.new(-37.74, 64.29, -1310.49)},
        ["Zone 7"] = {ID = 7, CF = CFrame.new(720.29, 151.40, 928.70)},
        ["Zone 8"] = {ID = 8, CF = CFrame.new(1845.65, 141.20, 92.68)},
        ["Zone 9"] = {ID = 9, CF = CFrame.new(577.43, 572.52, 410.76)},
        ["Zone 10"] = {ID = 10, CF = CFrame.new(4268.35, 164.38, -596.46)},
        ["Zone 11"] = {ID = 11, CF = CFrame.new(809.60, 207.00, -1007.67)},
        ["Zone 12"] = {ID = 12, CF = CFrame.new(3871.03, 132.49, 871.68)},
        ["Zone 13"] = {ID = 13, CF = CFrame.new(3858.53, 1394.98, -1179.79)},
    },
    Durability = { ID = 2,
        ["Zone 1"] = {ID = 1, CF = CFrame.new(68.56, 69.26, 874.46)},
        ["Zone 2"] = {ID = 2, CF = CFrame.new(-1596.63, 61.62, -544.21)},
        ["Zone 3"] = {ID = 3, CF = CFrame.new(-76.78, 61.01, 2011.45)},
        ["Zone 4"] = {ID = 4, CF = CFrame.new(-619.14, 179.00, 733.60)},
        ["Zone 5"] = {ID = 5, CF = CFrame.new(-1114.76, 212.63, -958.17)},
        ["Zone 6"] = {ID = 6, CF = CFrame.new(-330.35, 72.62, -1648.85)},
        ["Zone 7"] = {ID = 7, CF = CFrame.new(2467.42, 1539.63, -375.34)},
        ["Zone 8"] = {ID = 8, CF = CFrame.new(-2756.38, -227.67, 351.00)},
        ["Zone 9"] = {ID = 9, CF = CFrame.new(2161.75, 506.88, 540.61)},
        ["Zone 10"] = {ID = 10, CF = CFrame.new(1667.42, 504.63, -1357.30)},
        ["Zone 11"] = {ID = 11, CF = CFrame.new(207.38, 773.59, -695.54)},
        ["Zone 12"] = {ID = 12, CF = CFrame.new(2606.50, 63.23, 1701.51)},
    },
    Chakra = { ID = 3,
        ["Zone 1"] = {ID = 1, CF = CFrame.new(-11.19, 65.00, -125.96)},
        ["Zone 2"] = {ID = 2, CF = CFrame.new(1431.81, 147.00, -581.43)},
        ["Zone 3"] = {ID = 3, CF = CFrame.new(915.64, 141.00, 782.18)},
        ["Zone 4"] = {ID = 4, CF = CFrame.new(1566.39, 388.75, 675.06)},
        ["Zone 5"] = {ID = 5, CF = CFrame.new(338.15, -151.82, -1809.55)},
        ["Zone 6"] = {ID = 6, CF = CFrame.new(1027.54, 251.00, -617.81)},
        ["Zone 7"] = {ID = 7, CF = CFrame.new(3053.71, 110.90, 1106.41)},
        ["Zone 8"] = {ID = 8, CF = CFrame.new(1636.90, 269.72, 1764.92)},
        ["Zone 9"] = {ID = 9, CF = CFrame.new(-33.31, 62.13, -474.89)},
        ["Zone 10"] = {ID = 10, CF = CFrame.new(-390.09, 1232.11, 670.93)},
        ["Zone 11"] = {ID = 11, CF = CFrame.new(-389.66, 1231.90, 671.91)},
        ["Zone 12"] = {ID = 12, CF = CFrame.new(3230.93, -440.98, -248.49)},
        ["Zone 13"] = {ID = 13, CF = CFrame.new(337.44, 61.01, 1866.17)},
    },
    Agility = { ID = 5,
        ["Zone 1"] = {ID = 1, CF = CFrame.new(43.25, 69.18, 453.19)},
        ["Zone 2"] = {ID = 2, CF = CFrame.new(-391.45, 105.00, -58.40)},
        ["Zone 3"] = {ID = 3, CF = CFrame.new(3493.00, 60.00, 148.29)},
        ["Zone 4"] = {ID = 4, CF = CFrame.new(4111.04, 60.92, 844.02)},
    },
    Speed = { ID = 6,
        ["Zone 1"] = {ID = 1, CF = CFrame.new(-129.62, 61.00, -508.41)},
        ["Zone 2"] = {ID = 2, CF = CFrame.new(-391.45, 105.00, -58.40)},
        ["Zone 3"] = {ID = 3, CF = CFrame.new(3493.00, 60.00, 148.29)},
        ["Zone 4"] = {ID = 4, CF = CFrame.new(4111.04, 60.92, 844.02)},
    }
}

local ControlSection = Tabs.Main:Section("Automation Controls")
ControlSection:Toggle("FarmToggle", { Title = "Enable Auto Farm", Default = false, Callback = function(V) Config.AutoFarm = V end })
ControlSection:Toggle("TPToggle", { Title = "Enable Auto TP", Default = false, Callback = function(V) Config.AutoTP = V end })
ControlSection:Toggle("AutoClaimChikara", { Title = "Enable Auto Claim Chikara", Default = false, Callback = function(V) Config.AutoClaimChikara = V end })

local SelectionSection = Tabs.Main:Section("Location Selection")
local ZoneDropdown

SelectionSection:Dropdown("StatSelect", {
    Title = "1. Choose Stat",
    Values = {"Strength", "Durability", "Chakra", "Agility", "Speed"},
    Default = "Strength",
    Callback = function(Value)
        Config.SelectedStat = Zones[Value].ID
        local newZones = {}
        for zoneName, _ in pairs(Zones[Value]) do
            if zoneName ~= "ID" then table.insert(newZones, zoneName) end
        end
        table.sort(newZones, function(a, b) return tonumber(a:match("%d+")) < tonumber(b:match("%d+")) end)
        ZoneDropdown:SetValues(newZones)
        ZoneDropdown:SetValue(newZones[1])
    end
})

ZoneDropdown = SelectionSection:Dropdown("ZoneSelect", {
    Title = "2. Choose Zone",
    Values = {"Zone 1"},
    Default = "Zone 1",
    Callback = function(Value)
        local currentStatName
        for name, data in pairs(Zones) do if data.ID == Config.SelectedStat then currentStatName = name end end
        local selectedData = Zones[currentStatName][Value]
        if selectedData then
            Config.SelectedZoneID = selectedData.ID
            Config.SelectedCFrame = selectedData.CF
        end
    end
})

local PlayerSection = Tabs.Player:Section("Character Modifiers")
PlayerSection:Slider("WalkSpeedSlider", {
    Title = "Walk Speed",
    Default = 16, Min = 16, Max = 300, Rounding = 1,
    Callback = function(Value)
        Config.WalkSpeed = Value
        if LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("Humanoid") then
            LocalPlayer.Character.Humanoid.WalkSpeed = Value
        end
    end
})

PlayerSection:Slider("JumpPowerSlider", {
    Title = "Jump Power",
    Default = 50, Min = 50, Max = 500, Rounding = 1,
    Callback = function(Value)
        Config.JumpPower = Value
        if LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("Humanoid") then
            LocalPlayer.Character.Humanoid.UseJumpPower = true
            LocalPlayer.Character.Humanoid.JumpPower = Value
        end
    end
})

PlayerSection:Toggle("InfiniteJumpToggle", {
    Title = "Infinite Jump", Default = false,
    Callback = function(Value) Config.InfiniteJump = Value end
})

-- [ INSTRUCTIONS SECTION ]
Tabs.Main:AddParagraph("Instructions", {
    Title = "How to use the Auto Claim:",
    Content = "1. Select the Stat you want to train (Strength, Chakra, etc.)\n" ..
              "2. Select the Zone (higher zones require more stats).\n" ..
              "3. Equip the tool you want to use to train.\n" ..
              "4. You will Auto TP back to the training zone you selected.\n\n" ..
              "Note: 'Auto Claim Chikara' will sweep the map every 60 seconds and return you to your training spot automatically."
})
---------------------------------------------------------
-- CHIKARA LOGIC (Hard Cooldown + Guaranteed Return)
---------------------------------------------------------
function instantClaimAndReturn()
    local boxesFolder = workspace:FindFirstChild("Scriptable") and workspace.Scriptable:FindFirstChild("ChikaraBoxes")
    if not boxesFolder then return false end

    local character = LocalPlayer.Character
    local rootPart = character and character:FindFirstChild("HumanoidRootPart")
    if not rootPart then return false end

    local children = boxesFolder:GetChildren()
    local foundAnyReady = false

    for _, box in ipairs(children) do
        if not Config.AutoClaimChikara then break end

        -- State Check: Is it used?
        local usedPart = box:FindFirstChild("Used")
        local isUsed = false
        if usedPart and (usedPart:IsA("Model") or (usedPart:IsA("BasePart") and usedPart.Transparency < 1)) then
            isUsed = true
        end

        if not isUsed then
            local targetPart = box:FindFirstChild("ClickBox") or box:FindFirstChildWhichIsA("BasePart", true)
            
            if targetPart then
                foundAnyReady = true
                -- Teleport to Box
                rootPart.CFrame = targetPart.CFrame
                task.wait(0.25)
                
                local cd = box:FindFirstChildWhichIsA("ClickDetector", true)
                if cd then
                    fireclickdetector(cd)
                end
                task.wait(0.35) -- Increased wait to ensure server registers the "Used" state
            end
        end
    end

    -- GUARANTEED RETURN: If we moved at all, snap back to the farm
    if foundAnyReady and Config.AutoClaimChikara then
        task.wait(0.2)
        rootPart.CFrame = Config.SelectedCFrame
        print("Sweep finished. Returning to farm.")
    end
    
    return foundAnyReady
end

-- Chikara Loop
task.spawn(function()
    while true do
        if Config.AutoClaimChikara then
            local didSomething = instantClaimAndReturn()
            
            if didSomething then
                -- Hard 1-minute cooldown after claiming any box
                print("Cooldown started: 60 seconds.")
                task.wait(60)
            else
                -- If map was checked and everything was already 'Used', wait 5s to check again
                task.wait(5)
            end
        else
            task.wait(1)
        end
    end
end)
UserInputService.JumpRequest:Connect(function()
    if Config.InfiniteJump then
        local Humanoid = LocalPlayer.Character and LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
        if Humanoid then Humanoid:ChangeState(Enum.HumanoidStateType.Jumping) end
    end
end)

LocalPlayer.CharacterAdded:Connect(function(Character)
    local Humanoid = Character:WaitForChild("Humanoid")
    task.wait(0.5)
    Humanoid.WalkSpeed = Config.WalkSpeed
    Humanoid.UseJumpPower = true
    Humanoid.JumpPower = Config.JumpPower
end)

task.spawn(function()
    while true do
        if Config.AutoClaimChikara then instantClaimAndReturn() end
        task.wait(2)
    end
end)

task.spawn(function()
    while task.wait(0.1) do
        if Config.AutoFarm then
            local CharPath = workspace:FindFirstChild("Scriptable") and workspace.Scriptable:FindFirstChild("Characters")
            local Char = CharPath and CharPath:FindFirstChild(LocalPlayer.Name)
            if Char then
                if Config.AutoTP and Char:FindFirstChild("HumanoidRootPart") then
                    Char.HumanoidRootPart.CFrame = Config.SelectedCFrame
                end
                if Config.SelectedStat == 1 or Config.SelectedStat == 4 then
                    game:GetService("VirtualInputManager"):SendMouseButtonEvent(0, 0, 0, true, game, 0)
                    task.wait()
                    game:GetService("VirtualInputManager"):SendMouseButtonEvent(0, 0, 0, false, game, 0)
                end
                local remote = ReplicatedStorage:FindFirstChild("Remotes") and ReplicatedStorage.Remotes:FindFirstChild("RemoteEvent")
                if remote then remote:FireServer("Stat", Config.SelectedStat, Config.SelectedZoneID) end
            end
        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: