YML Hub Ton Battle Script Keyless
TON Battle Keyless
YML Hub Ton Battle Script Keyless
👤 alexriderr 👁 8 views ❤️ 0 likes ⏱ Apr 17, 2026
This script includes multiple case options. Simply choose a case, set the quantity between 0 and 10, then click “Open” once.
✨ Features
Auto open Auto sell Open once
📋 Script Code
local player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local Lighting = game:GetService("Lighting")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")

local remoteEvents = {}
local function getRemote(name)
    if remoteEvents[name] then return remoteEvents[name] end
    local remote = ReplicatedStorage:FindFirstChild("Events") and ReplicatedStorage.Events:FindFirstChild(name)
        or ReplicatedStorage:FindFirstChild(name)
        or ReplicatedStorage:FindFirstChild("Remotes") and ReplicatedStorage.Remotes:FindFirstChild(name)
    if remote then
        remoteEvents[name] = remote
        return remote
    end
    return nil
end

local Theme = {
    Bg = Color3.fromRGB(12, 12, 16),
    Panel = Color3.fromRGB(22, 22, 28),
    Accent = Color3.fromRGB(0, 255, 220),
    AccentDark = Color3.fromRGB(0, 180, 150),
    Text = Color3.fromRGB(230, 230, 235),
    TextMuted = Color3.fromRGB(100, 100, 110),
    CloseBtn = Color3.fromRGB(255, 60, 60),
}

local function formatPrice(value)
    if value == 0 then return "FREE" end
    local str = tostring(math.floor(value))
    local result = ""
    local count = 0
    for i = #str, 1, -1 do
        if count > 0 and count % 3 == 0 then
            result = "," .. result
        end
        result = str:sub(i, i) .. result
        count = count + 1
    end
    return result
end

local CasesDatabase = {
    {Name = "Trash", Price = 0}, {Name = "Daily", Price = 0},
    {Name = "Beggar", Price = 220}, {Name = "Plodder", Price = 444},
    {Name = "Office Clerk", Price = 689}, {Name = "Manager", Price = 835},
    {Name = "Director", Price = 926}, {Name = "Oligarch", Price = 1364},
    {Name = "Gold", Price = 1999}, {Name = "Frozen Heart", Price = 4500},
    {Name = "Dark", Price = 4999}, {Name = "Bubble Gum", Price = 12000},
    {Name = "Palm", Price = 13999}, {Name = "Burj", Price = 37999},
    {Name = "Cats", Price = 40000}, {Name = "M5 F90", Price = 55555},
    {Name = "Luxury", Price = 119999}, {Name = "Glitch", Price = 135000},
    {Name = "G63", Price = 177777}, {Name = "Dream", Price = 250000},
    {Name = "Porsche 911", Price = 599999}, {Name = "URUS", Price = 1666666},
    {Name = "Bloody Night", Price = 5000000}, {Name = "Marina", Price = 12999999},
    {Name = "Abyss Core", Price = 33000000}, {Name = "Cursed Demon", Price = 36666666},
    {Name = "Heavenfall", Price = 64000000},
    {Name = "Photon Core", Price = 43333},
    {Name = "Divine", Price = 500000},
    {Name = "Sunny Day", Price = 1000}
}
local specialCases = {["Photon Core"] = true, ["Divine"] = true, ["Sunny Day"] = true}
table.sort(CasesDatabase, function(a, b)
    local aSpecial = specialCases[a.Name]
    local bSpecial = specialCases[b.Name]
    if aSpecial and not bSpecial then return false end
    if not aSpecial and bSpecial then return true end
    return a.Price < b.Price
end)

local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
gui.Name = "TON_Hub"
gui.ResetOnSpawn = false

local blur = Instance.new("BlurEffect", Lighting)
blur.Size = 0

local function createGradient(parent)
    local g = Instance.new("UIGradient", parent)
    g.Rotation = 45
    g.Color = ColorSequence.new {
        ColorSequenceKeypoint.new(0, Color3.fromRGB(25, 25, 32)),
        ColorSequenceKeypoint.new(1, Color3.fromRGB(15, 15, 20))
    }
    return g
end

local main = Instance.new("Frame", gui)
main.Size = UDim2.new(0, 700, 0, 400)
main.Position = UDim2.new(0.5, 0, 0.5, 0)
main.AnchorPoint = Vector2.new(0.5, 0.5)
main.BackgroundColor3 = Theme.Bg
main.BorderSizePixel = 0
main.Visible = false
createGradient(main)
Instance.new("UICorner", main).CornerRadius = UDim.new(0, 14)

local stroke = Instance.new("UIStroke", main)
stroke.Thickness = 1
stroke.Color = Color3.fromRGB(40, 40, 50)

local accentStroke = Instance.new("UIStroke", main)
accentStroke.Thickness = 2
accentStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border

local rgbHue = 0
task.spawn(function()
    while main.Parent do
        rgbHue = (rgbHue + 0.3) % 360
        accentStroke.Color = Color3.fromHSV(rgbHue / 360, 0.8, 1)
        RunService.Heartbeat:Wait()
    end
end)

local header = Instance.new("Frame", main)
header.Size = UDim2.new(1, 0, 0, 45)
header.BackgroundTransparency = 1
header.Position = UDim2.new(0, 0, 0, 0)

local title = Instance.new("TextLabel", header)
title.Size = UDim2.new(0, 250, 1, 0)
title.Position = UDim2.new(0, 15, 0, 0)
title.Text = "YML HUB | TON BATTLE"
title.TextColor3 = Theme.Accent
title.Font = Enum.Font.GothamBold
title.TextSize = 16
title.BackgroundTransparency = 1
title.TextXAlignment = Enum.TextXAlignment.Left

local closeBtn = Instance.new("TextButton", header)
closeBtn.Size = UDim2.new(0, 32, 0, 32)
closeBtn.Position = UDim2.new(1, -42, 0.5, 0)
closeBtn.AnchorPoint = Vector2.new(0.5, 0.5)
closeBtn.Text = "X"
closeBtn.BackgroundTransparency = 1
closeBtn.TextColor3 = Theme.CloseBtn
closeBtn.Font = Enum.Font.GothamBold
closeBtn.TextSize = 18

closeBtn.MouseEnter:Connect(function()
    TweenService:Create(closeBtn, TweenInfo.new(0.15), {TextColor3 = Color3.new(1, 1, 1)}):Play()
end)
closeBtn.MouseLeave:Connect(function()
    TweenService:Create(closeBtn, TweenInfo.new(0.15), {TextColor3 = Theme.CloseBtn}):Play()
end)
closeBtn.MouseButton1Click:Connect(function() toggleUI(false) end)

local leftPanel = Instance.new("Frame", main)
leftPanel.Size = UDim2.new(0, 260, 1, -65)
leftPanel.Position = UDim2.new(0, 15, 0, 50)
leftPanel.BackgroundColor3 = Theme.Panel
leftPanel.BackgroundTransparency = 0.5
leftPanel.BorderSizePixel = 0
Instance.new("UICorner", leftPanel).CornerRadius = UDim.new(0, 10)

local amountLabel = Instance.new("TextLabel", leftPanel)
amountLabel.Size = UDim2.new(1, -20, 0, 20)
amountLabel.Position = UDim2.new(0, 10, 0, 15)
amountLabel.Text = "Quantity (1-10)"
amountLabel.TextColor3 = Theme.TextMuted
amountLabel.Font = Enum.Font.GothamBold
amountLabel.TextSize = 11
amountLabel.BackgroundTransparency = 1
amountLabel.TextXAlignment = Enum.TextXAlignment.Left

local amountInput = Instance.new("TextBox", leftPanel)
amountInput.Size = UDim2.new(1, -20, 0, 38)
amountInput.Position = UDim2.new(0, 10, 0, 40)
amountInput.PlaceholderText = "1"
amountInput.Text = ""
amountInput.BackgroundColor3 = Color3.fromRGB(30, 30, 35)
amountInput.TextColor3 = Theme.Text
amountInput.PlaceholderColor3 = Color3.fromRGB(80, 80, 90)
amountInput.Font = Enum.Font.GothamMedium
amountInput.TextSize = 14
Instance.new("UICorner", amountInput).CornerRadius = UDim.new(0, 6)

local selectedLabel = Instance.new("TextLabel", leftPanel)
selectedLabel.Size = UDim2.new(1, -20, 0, 20)
selectedLabel.Position = UDim2.new(0, 10, 0, 90)
selectedLabel.Text = "Selected Case"
selectedLabel.TextColor3 = Theme.TextMuted
selectedLabel.Font = Enum.Font.GothamBold
selectedLabel.TextSize = 11
selectedLabel.BackgroundTransparency = 1
selectedLabel.TextXAlignment = Enum.TextXAlignment.Left

local selectedCase = Instance.new("TextButton", leftPanel)
selectedCase.Size = UDim2.new(1, -20, 0, 38)
selectedCase.Position = UDim2.new(0, 10, 0, 115)
selectedCase.Text = "Select a case..."
selectedCase.TextColor3 = Color3.fromRGB(90, 90, 100)
selectedCase.BackgroundColor3 = Color3.fromRGB(30, 30, 35)
selectedCase.Font = Enum.Font.GothamMedium
selectedCase.TextSize = 13
Instance.new("UICorner", selectedCase).CornerRadius = UDim.new(0, 6)

local function createActionBtn(parent, text, yPos, callback)
    local btn = Instance.new("TextButton", parent)
    btn.Size = UDim2.new(1, -20, 0, 40)
    btn.Position = UDim2.new(0, 10, 0, yPos)
    btn.Text = text
    btn.BackgroundColor3 = Color3.fromRGB(35, 35, 42)
    btn.TextColor3 = Theme.Text
    btn.Font = Enum.Font.GothamBold
    btn.TextSize = 12
    btn.BorderSizePixel = 0
    btn.AutoButtonColor = false
    btn.ZIndex = 10
    local c = Instance.new("UICorner", btn)
    c.CornerRadius = UDim.new(0, 6)
    
    local accent = Instance.new("Frame", btn)
    accent.Size = UDim2.new(0, 3, 1, 0)
    accent.Position = UDim2.new(0, 0, 0, 0)
    accent.BackgroundColor3 = Theme.Accent
    accent.BackgroundTransparency = 1
    accent.ZIndex = 10
    local ac = Instance.new("UICorner", accent)
    ac.CornerRadius = UDim.new(0, 0)
    
    btn.MouseEnter:Connect(function()
        TweenService:Create(btn, TweenInfo.new(0.15), {BackgroundColor3 = Color3.fromRGB(45, 45, 55)}):Play()
        TweenService:Create(accent, TweenInfo.new(0.15), {BackgroundTransparency = 0}):Play()
    end)
    btn.MouseLeave:Connect(function()
        TweenService:Create(btn, TweenInfo.new(0.15), {BackgroundColor3 = Color3.fromRGB(35, 35, 42)}):Play()
        TweenService:Create(accent, TweenInfo.new(0.15), {BackgroundTransparency = 1}):Play()
    end)
    btn.MouseButton1Click:Connect(function()
        callback(btn)
    end)
    return btn
end

local selectedCaseName = ""
local selectedCaseObj = nil

selectedCase.MouseButton1Click:Connect(function()
    selectedCaseName = ""
    selectedCaseObj = nil
    selectedCase.Text = "Select a case..."
    selectedCase.TextColor3 = Color3.fromRGB(90, 90, 100)
end)

createActionBtn(leftPanel, "OPEN ONCE", 165, function()
    local name = selectedCaseName
    if name == "" then return end
    local amount = tonumber(amountInput.Text) or 1
    if amount  10 then amount = 10 end
    local remote = getRemote("OpenCase")
    if remote then
        pcall(function() 
            if remote:IsA("RemoteFunction") then
                remote:InvokeServer(name, amount)
            else
                remote:FireServer(name, amount)
            end
        end)
    end
end)

local autoOpen = false
local autoOpenBtn = nil

local function processOpen()
    local name = selectedCaseName
    if name == "" then return end
    local amount = tonumber(amountInput.Text) or 1
    if amount  10 then amount = 10 end
    local remote = getRemote("OpenCase")
    if remote then
        pcall(function() remote:InvokeServer(name, amount) end)
    end
end

autoOpenBtn = createActionBtn(leftPanel, "AUTO OPEN: OFF", 215, function(b)
    autoOpen = not autoOpen
    b.Text = autoOpen and "AUTO OPEN: ON" or "AUTO OPEN: OFF"
    b.TextColor3 = autoOpen and Theme.Accent or Theme.Text
    if autoOpen and selectedCaseName == "" then
        autoOpen = false
        b.Text = "AUTO OPEN: OFF"
        b.TextColor3 = Theme.Text
        return
    end
    if autoOpen then
        task.spawn(function()
            while autoOpen do
                processOpen()
                task.wait(1)
            end
        end)
    end
end)

local autoSell = false
local autoSellBtn = nil
autoSellBtn = createActionBtn(leftPanel, "AUTO SELL: OFF", 265, function(b)
    autoSell = not autoSell
    b.Text = autoSell and "AUTO SELL: ON" or "AUTO SELL: OFF"
    b.TextColor3 = autoSell and Theme.Accent or Theme.Text
    if autoSell then
        task.spawn(function()
            while autoSell do
                local remote = getRemote("Inventory")
                if remote then
                    pcall(function() remote:FireServer("Sell", "ALL", false) end)
                end
                task.wait(2)
            end
        end)
    end
end)

local rightPanel = Instance.new("Frame", main)
rightPanel.Size = UDim2.new(1, -295, 1, -65)
rightPanel.Position = UDim2.new(0, 280, 0, 50)
rightPanel.BackgroundColor3 = Theme.Panel
rightPanel.BackgroundTransparency = 0.5
rightPanel.BorderSizePixel = 0
Instance.new("UICorner", rightPanel).CornerRadius = UDim.new(0, 10)

local listTitle = Instance.new("TextLabel", rightPanel)
listTitle.Size = UDim2.new(1, -20, 0, 25)
listTitle.Position = UDim2.new(0, 10, 0, 8)
listTitle.Text = "Available Cases"
listTitle.TextColor3 = Theme.TextMuted
listTitle.Font = Enum.Font.GothamBold
listTitle.TextSize = 11
listTitle.BackgroundTransparency = 1
listTitle.TextXAlignment = Enum.TextXAlignment.Left

local scroll = Instance.new("ScrollingFrame", rightPanel)
scroll.Size = UDim2.new(1, -20, 1, -45)
scroll.Position = UDim2.new(0, 10, 0, 40)
scroll.BackgroundTransparency = 1
scroll.BorderSizePixel = 0
scroll.ScrollBarThickness = 3
scroll.ScrollBarImageColor3 = Theme.Accent
scroll.CanvasSize = UDim2.new(0, 0, 0, #CasesDatabase * 38 + 10)
Instance.new("UIListLayout", scroll).Padding = UDim.new(0, 4)

for _, data in pairs(CasesDatabase) do
    local item = Instance.new("TextButton", scroll)
    item.Size = UDim2.new(1, 0, 0, 34)
    item.Text = "  " .. data.Name
    item.TextColor3 = Theme.Text
    item.BackgroundColor3 = Color3.fromRGB(35, 35, 42)
    item.BackgroundTransparency = 0.5
    item.Font = Enum.Font.Gotham
    item.TextSize = 12
    item.TextXAlignment = Enum.TextXAlignment.Left
    item.BorderSizePixel = 0
    Instance.new("UICorner", item).CornerRadius = UDim.new(0, 5)
    
    local price = Instance.new("TextLabel", item)
    price.Size = UDim2.new(0, 105, 1, 0)
    price.Position = UDim2.new(1, -110, 0, 0)
    local function getPriceText(price, name)
    if price == 0 then return "FREE" end
    local icon = ""
    if name == "Photon Core" then icon = "💠"
    elseif name == "Divine" then icon = "💠"
    elseif name == "Sunny Day" then icon = "💎"
    else icon = "★" end
    return icon .. " " .. formatPrice(price)
end
    
    price.Text = getPriceText(data.Price, data.Name)
    price.TextColor3 = data.Price == 0 and Color3.fromRGB(0, 220, 100) or Theme.Accent
    price.BackgroundTransparency = 1
    price.Font = Enum.Font.GothamBold
    price.TextSize = 11
    price.TextXAlignment = Enum.TextXAlignment.Right
    
    item.MouseEnter:Connect(function()
        TweenService:Create(item, TweenInfo.new(0.1), {BackgroundColor3 = Color3.fromRGB(50, 50, 60)}):Play()
    end)
    item.MouseLeave:Connect(function()
        TweenService:Create(item, TweenInfo.new(0.1), {BackgroundColor3 = Color3.fromRGB(35, 35, 42)}):Play()
    end)
    item.MouseButton1Click:Connect(function()
        selectedCaseName = data.Name
        selectedCaseObj = item
        selectedCase.Text = data.Name
        selectedCase.TextColor3 = Theme.Text
    end)
end

local function toggleUI(state)
    local visible = (state ~= nil) and state or not main.Visible
    if visible then
        main.Size = UDim2.new(0, 0, 0, 0)
        main.Visible = true
        TweenService:Create(main, TweenInfo.new(0.4, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {Size = UDim2.new(0, 700, 0, 400)}):Play()
        TweenService:Create(blur, TweenInfo.new(0.3), {Size = 12}):Play()
    else
        local t = TweenService:Create(main, TweenInfo.new(0.3, Enum.EasingStyle.Back, Enum.EasingDirection.In), {Size = UDim2.new(0, 0, 0, 0)})
        t:Play()
        TweenService:Create(blur, TweenInfo.new(0.3), {Size = 0}):Play()
        t.Completed:Wait()
        main.Visible = false
    end
end

local dragging, dragStart, startPos
main.InputBegan:Connect(function(i)
    if i.UserInputType == Enum.UserInputType.MouseButton1 then
        dragging = true
        dragStart = i.Position
        startPos = main.Position
    end
end)
UIS.InputChanged:Connect(function(i)
    if dragging and i.UserInputType == Enum.UserInputType.MouseMovement then
        local delta = i.Position - dragStart
        main.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
    end
end)
UIS.InputEnded:Connect(function(i)
    if i.UserInputType == Enum.UserInputType.MouseButton1 then dragging = false end
end)

UIS.InputBegan:Connect(function(i, g)
    if not g and i.KeyCode == Enum.KeyCode.Z then toggleUI() end
end)

toggleUI(true)
🎮 Similar Scripts
💬 Comments (0)
Login to post a comment
No comments yet. Be the first!
Script Info
Game TON Battle
TypeKeyless
Authoralexriderr
Views8
Likes0
PublishedApr 17, 2026
🎮 Play Game on Roblox
🕐 Recent Scripts
Auto Best Plants Script
Auto Best Plants Script
Escape a Garden • 👁 2
Keyless
Legends Of Speed SP Hub v1.3 Duplicate Pets, Auto Evolve
Legends Of Speed SP Hub v1.3 Duplicate Pets, Auto Evolve
Legends Of Speed • 👁 6
Keyless
+1 Jump and Escape Brainrot Script – Auto collect cash
+1 Jump and Escape Brainrot Script – Auto collect cash
+1 Jump and Escape Brainrot • 👁 9
Keyless
Bridger Western Auto Farm Script Working
Bridger Western Auto Farm Script Working
bridger: WESTERN • 👁 9
Keyless
Murder Mystery 2 Script | ESP, Aimbot, Silent Aim
Murder Mystery 2 Script | ESP, Aimbot, Silent Aim
Murder Mystery 2 • 👁 11
Keyless