Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ============================================================================
- -- GLEAVIN HUB // LEVEL FARM (Custom Lightweight UI)
- -- ============================================================================
- task.spawn(function()
- if getgenv().__GLEAVIN_LEVEL_LOADED then return end
- getgenv().__GLEAVIN_LEVEL_LOADED = true
- -- Services
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local TweenService = game:GetService("TweenService")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local VirtualInputManager = game:GetService("VirtualInputManager")
- local HttpService = game:GetService("HttpService")
- local LP = Players.LocalPlayer
- local t = LP
- local CommF = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("CommF_")
- local UserInputService = game:GetService("UserInputService")
- -- Safe Wait for Game Load
- local startWait = tick()
- while not (game:IsLoaded() and LP:FindFirstChild("DataLoaded")) do
- if tick() - startWait > 15 then break end
- task.wait(0.5)
- end
- -- Settings Table
- local Settings = {
- StartFarm = false,
- Weapon = "Melee",
- FastAttack = false,
- SpeedTween = 300,
- AutoQuest = true,
- }
- -- ============================================================================
- -- CORE LOGIC
- -- ============================================================================
- local function getHRP()
- local c = t.Character or t.CharacterAdded:Wait()
- return c:FindFirstChild("HumanoidRootPart")
- end
- getgenv().TweenManager = {
- currentTween = nil,
- CancelTweenOnly = function()
- if getgenv().TweenManager.currentTween then
- pcall(function() getgenv().TweenManager.currentTween:Cancel() end)
- getgenv().TweenManager.currentTween = nil
- end
- end,
- PlayTween = function(part, info, goal)
- getgenv().TweenManager.CancelTweenOnly()
- local tw = TweenService:Create(part, info, goal)
- getgenv().TweenManager.currentTween = tw
- tw:Play()
- return tw
- end
- }
- TweenManager = getgenv().TweenManager
- function toTarget(P, skipCheck)
- if typeof(P) ~= "CFrame" then return end
- local char = t.Character
- if not char then return end
- local hrp = char:FindFirstChild("HumanoidRootPart")
- if not hrp then return end
- if not hrp:FindFirstChild("FloatForce") then
- local bv = Instance.new("BodyVelocity")
- bv.Name = "FloatForce"
- bv.Velocity = Vector3.new(0, 0, 0)
- bv.MaxForce = Vector3.new(100000, 100000, 100000)
- bv.Parent = hrp
- end
- local dist = (P.Position - hrp.Position).Magnitude
- if dist < (skipCheck and 8 or 150) then
- TweenManager.CancelTweenOnly()
- hrp.CFrame = P
- return
- end
- local speed = Settings.SpeedTween or 300
- TweenManager.PlayTween(hrp, TweenInfo.new(dist / speed, Enum.EasingStyle.Linear), { CFrame = P })
- end
- function equiptool(name)
- if name and t:FindFirstChild("Backpack") and t.Backpack:FindFirstChild(name) then
- t.Character.Humanoid:EquipTool(t.Backpack:FindFirstChild(name))
- end
- end
- function NameWeapon(tooltip, returnTool)
- local function find(container)
- for _, item in pairs(container:GetChildren()) do
- if item:IsA("Tool") and item.ToolTip == tooltip then return returnTool and item or item.Name end
- end
- end
- return find(t.Backpack) or find(t.Character)
- end
- function UsedualFlock() equiptool(NameWeapon(Settings.Weapon or "Melee")) end
- -- Combat
- local G_Combat, NetMod
- pcall(function()
- G_Combat = require(ReplicatedStorage.Modules.CombatUtil)
- NetMod = require(ReplicatedStorage.Modules.Net)
- end)
- local RegisterAttack = ReplicatedStorage.Modules.Net:WaitForChild("RE/RegisterAttack")
- local RegisterHit = NetMod and NetMod:RemoteEvent("RegisterHit", true)
- local function AttackAOE(radius)
- local found = {}
- local myHRP = t.Character.HumanoidRootPart
- for _, mob in pairs(workspace.Enemies:GetChildren()) do
- if mob:FindFirstChild("HumanoidRootPart") and mob.Humanoid.Health > 0 then
- if (mob.HumanoidRootPart.Position - myHRP.Position).Magnitude <= radius + 15 then
- table.insert(found, { mob, mob.HumanoidRootPart })
- end
- end
- end
- return #found > 0 and found or nil
- end
- function AttackFunction(radius)
- if t.Character.Stun.Value ~= 0 then return end
- local hits = AttackAOE(radius)
- if not hits then return end
- if RegisterAttack and RegisterHit then
- RegisterAttack:FireServer(0)
- RegisterHit:FireServer(table.remove(hits, 1)[2], hits)
- end
- end
- function ClickM1(mob, isBoat)
- if not mob or not mob:FindFirstChild("HumanoidRootPart") then return end
- if Settings.Weapon == "Blox Fruit" then
- local fruitTool = t.Character:FindFirstChild(NameWeapon("Blox Fruit"))
- if fruitTool and fruitTool:FindFirstChild("LeftClickRemote") then
- local lookDir = (mob.HumanoidRootPart.Position - t.Character.HumanoidRootPart.Position).Unit
- fruitTool.LeftClickRemote:FireServer(lookDir, math.random(1, 5))
- return
- end
- end
- AttackFunction(isBoat and 80 or 30)
- end
- -- Fast Attack
- local CombatFrameworkR = nil
- pcall(function()
- local cfMod = require(t.PlayerScripts:WaitForChild("CombatFramework"))
- local ups = getupvalues or (debug and debug.getupvalues)
- CombatFrameworkR = ups and ups(cfMod) and ups(cfMod)[2]
- end)
- task.spawn(function()
- while task.wait() do
- if Settings.FastAttack and CombatFrameworkR and CombatFrameworkR.activeController then
- pcall(function()
- local c = CombatFrameworkR.activeController
- c.hitboxMagnitude = 60
- c.timeToNextAttack = 0
- c.attacking = false
- if c.attack then c:attack() end
- end)
- end
- end
- end)
- -- Mob Detection
- function IsMobAlive(mob)
- return mob and mob.Parent and mob:FindFirstChild("HumanoidRootPart") and mob.Humanoid.Health > 0
- end
- function DetectMob(nameOrList)
- local best, bestDist = nil, math.huge
- for _, mob in pairs(workspace.Enemies:GetChildren()) do
- if (typeof(nameOrList) == "table" and table.find(nameOrList, mob.Name) or mob.Name == nameOrList) and IsMobAlive(mob) then
- local d = (mob.HumanoidRootPart.Position - t.Character.HumanoidRootPart.Position).Magnitude
- if d < bestDist then bestDist, best = d, mob end
- end
- end
- return best
- end
- function sizepart(mob)
- if t:DistanceFromCharacter(mob.HumanoidRootPart.Position) <= 50 then
- for _, part in pairs(mob:GetDescendants()) do if part:IsA("BasePart") and part.CanCollide then part.CanCollide = false end end
- end
- end
- -- Quest Logic
- function TakeQuestLevel()
- local quests = {
- {lvl = 1, name = "Bandit", quest = "BanditQuest1", id = 1},
- {lvl = 10, name = "Monkey", quest = "JungleQuest", id = 1},
- {lvl = 15, name = "Gorilla", quest = "JungleQuest", id = 2},
- {lvl = 30, name = "Pirate", quest = "BuggyQuest1", id = 1},
- {lvl = 60, name = "Desert Bandit", quest = "DesertQuest", id = 1},
- {lvl = 90, name = "Snow Bandit", quest = "SnowQuest", id = 1},
- {lvl = 120, name = "Chief Petty Officer", quest = "MarineQuest2", id = 1},
- {lvl = 150, name = "Sky Bandit", quest = "SkyQuest", id = 1},
- }
- local currentLvl = t.Data.Level.Value
- local target = nil
- for _, q in ipairs(quests) do if currentLvl >= q.lvl then target = q end end
- if target then
- CommF:InvokeServer("StartQuest", target.quest, target.id)
- end
- end
- -- Main Farm Loop
- function FarmMethod()
- if not t.PlayerGui.Main.Quest.Visible then
- if Settings.AutoQuest then TakeQuestLevel() end
- task.wait(1)
- return
- end
- local questTitle = t.PlayerGui.Main.Quest.Container.QuestTitle.Title.Text
- local mobName = ""
- for word in string.gmatch(questTitle, "%[([^%]]+)%]") do mobName = word end
- if mobName == "" then mobName = string.match(questTitle, "Defeat %d+ (.*)") end
- if not mobName or mobName == "" then return end
- local mob = DetectMob(mobName)
- if mob then
- repeat
- task.wait()
- if not IsMobAlive(mob) then break end
- sizepart(mob)
- UsedualFlock()
- if Settings.Weapon == "Blox Fruit" then
- toTarget(mob.HumanoidRootPart.CFrame * CFrame.new(-7, 20, 0))
- else
- toTarget(mob.HumanoidRootPart.CFrame * CFrame.new(7, 20, 0))
- end
- ClickM1(mob)
- until not IsMobAlive(mob) or not Settings.StartFarm
- else
- task.wait(1)
- end
- end
- task.spawn(function()
- while task.wait(0.1) do
- if Settings.StartFarm then
- pcall(FarmMethod)
- end
- end
- end)
- -- ============================================================================
- -- CUSTOM LIGHTWEIGHT UI (Mobile Friendly, Zero HTTP Requests)
- -- ============================================================================
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Name = "GleavinHubUI"
- ScreenGui.ResetOnSpawn = false
- ScreenGui.Parent = game:GetService("CoreGui")
- local MainFrame = Instance.new("Frame")
- MainFrame.Size = UDim2.new(0, 260, 0, 350)
- MainFrame.Position = UDim2.new(0.5, -130, 0.5, -175)
- MainFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 25)
- MainFrame.BorderSizePixel = 0
- MainFrame.Active = true
- MainFrame.Draggable = true
- MainFrame.Parent = ScreenGui
- local UICorner = Instance.new("UICorner")
- UICorner.CornerRadius = UDim.new(0, 8)
- UICorner.Parent = MainFrame
- local TitleBar = Instance.new("Frame")
- TitleBar.Size = UDim2.new(1, 0, 0, 40)
- TitleBar.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
- TitleBar.BorderSizePixel = 0
- TitleBar.Parent = MainFrame
- local TitleCorner = Instance.new("UICorner")
- TitleCorner.CornerRadius = UDim.new(0, 8)
- TitleCorner.Parent = TitleBar
- local TitleText = Instance.new("TextLabel")
- TitleText.Size = UDim2.new(1, -20, 1, 0)
- TitleText.Position = UDim2.new(0, 10, 0, 0)
- TitleText.BackgroundTransparency = 1
- TitleText.Text = "Gleavin Hub // Level Farm"
- TitleText.TextColor3 = Color3.fromRGB(255, 255, 255)
- TitleText.Font = Enum.Font.GothamBold
- TitleText.TextSize = 14
- TitleText.TextXAlignment = Enum.TextXAlignment.Left
- TitleText.Parent = TitleBar
- local ScrollFrame = Instance.new("ScrollingFrame")
- ScrollFrame.Size = UDim2.new(1, -20, 1, -50)
- ScrollFrame.Position = UDim2.new(0, 10, 0, 45)
- ScrollFrame.BackgroundTransparency = 1
- ScrollFrame.BorderSizePixel = 0
- ScrollFrame.ScrollBarThickness = 2
- ScrollFrame.ScrollBarImageColor3 = Color3.fromRGB(100, 100, 120)
- ScrollFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
- ScrollFrame.Parent = MainFrame
- local UIListLayout = Instance.new("UIListLayout")
- UIListLayout.Padding = UDim.new(0, 8)
- UIListLayout.Parent = ScrollFrame
- -- Helper: Toggle Button
- local function CreateToggle(name, defaultState, callback)
- local Btn = Instance.new("TextButton")
- Btn.Size = UDim2.new(1, -6, 0, 35)
- Btn.BackgroundColor3 = defaultState and Color3.fromRGB(40, 150, 60) or Color3.fromRGB(40, 40, 50)
- Btn.BorderSizePixel = 0
- Btn.Text = name .. (defaultState and " [ON]" or " [OFF]")
- Btn.TextColor3 = Color3.fromRGB(255, 255, 255)
- Btn.Font = Enum.Font.GothamMedium
- Btn.TextSize = 13
- Btn.Parent = ScrollFrame
- local c = Instance.new("UICorner")
- c.CornerRadius = UDim.new(0, 6)
- c.Parent = Btn
- local state = defaultState
- Btn.MouseButton1Click:Connect(function()
- state = not state
- Btn.BackgroundColor3 = state and Color3.fromRGB(40, 150, 60) or Color3.fromRGB(40, 40, 50)
- Btn.Text = name .. (state and " [ON]" or " [OFF]")
- callback(state)
- end)
- end
- -- Helper: Dropdown (cycles on click for mobile simplicity)
- local function CreateDropdown(name, options, default, callback)
- local Btn = Instance.new("TextButton")
- Btn.Size = UDim2.new(1, -6, 0, 35)
- Btn.BackgroundColor3 = Color3.fromRGB(40, 40, 50)
- Btn.BorderSizePixel = 0
- Btn.Text = name .. ": " .. default
- Btn.TextColor3 = Color3.fromRGB(255, 255, 255)
- Btn.Font = Enum.Font.GothamMedium
- Btn.TextSize = 13
- Btn.Parent = ScrollFrame
- local c = Instance.new("UICorner")
- c.CornerRadius = UDim.new(0, 6)
- c.Parent = Btn
- local currentIdx = 1
- for i, v in ipairs(options) do if v == default then currentIdx = i break end end
- Btn.MouseButton1Click:Connect(function()
- currentIdx = currentIdx + 1
- if currentIdx > #options then currentIdx = 1 end
- local newVal = options[currentIdx]
- Btn.Text = name .. ": " .. newVal
- callback(newVal)
- end)
- end
- -- Helper: Slider (+/- Buttons for mobile)
- local function CreateSlider(name, min, max, default, callback)
- local Frame = Instance.new("Frame")
- Frame.Size = UDim2.new(1, -6, 0, 40)
- Frame.BackgroundColor3 = Color3.fromRGB(40, 40, 50)
- Frame.BorderSizePixel = 0
- Frame.Parent = ScrollFrame
- local c = Instance.new("UICorner")
- c.CornerRadius = UDim.new(0, 6)
- c.Parent = Frame
- local Label = Instance.new("TextLabel")
- Label.Size = UDim2.new(1, -60, 1, 0)
- Label.Position = UDim2.new(0, 10, 0, 0)
- Label.BackgroundTransparency = 1
- Label.Text = name .. ": " .. default
- Label.TextColor3 = Color3.fromRGB(255, 255, 255)
- Label.Font = Enum.Font.GothamMedium
- Label.TextSize = 12
- Label.TextXAlignment = Enum.TextXAlignment.Left
- Label.Parent = Frame
- local Minus = Instance.new("TextButton")
- Minus.Size = UDim2.new(0, 25, 0, 25)
- Minus.Position = UDim2.new(1, -60, 0.5, -12.5)
- Minus.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
- Minus.Text = "-"
- Minus.TextColor3 = Color3.fromRGB(255, 255, 255)
- Minus.Parent = Frame
- local Plus = Instance.new("TextButton")
- Plus.Size = UDim2.new(0, 25, 0, 25)
- Plus.Position = UDim2.new(1, -30, 0.5, -12.5)
- Plus.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
- Plus.Text = "+"
- Plus.TextColor3 = Color3.fromRGB(255, 255, 255)
- Plus.Parent = Frame
- local val = default
- local step = math.max(1, math.floor((max - min) / 20))
- local function update()
- val = math.clamp(val, min, max)
- Label.Text = name .. ": " .. val
- callback(val)
- end
- Minus.MouseButton1Click:Connect(function() val = val - step; update() end)
- Plus.MouseButton1Click:Connect(function() val = val + step; update() end)
- end
- -- Build UI Elements
- CreateToggle("Start Farm", Settings.StartFarm, function(v) Settings.StartFarm = v end)
- CreateDropdown("Select Weapon", {"Melee", "Sword", "Blox Fruit"}, Settings.Weapon, function(v) Settings.Weapon = v end)
- CreateToggle("Fast Attack", Settings.FastAttack, function(v) Settings.FastAttack = v end)
- CreateToggle("Auto Quest", Settings.AutoQuest, function(v) Settings.AutoQuest = v end)
- CreateSlider("Tween Speed", 50, 500, Settings.SpeedTween, function(v) Settings.SpeedTween = v end)
- -- Update Canvas Size dynamically
- UIListLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
- ScrollFrame.CanvasSize = UDim2.new(0, 0, 0, UIListLayout.AbsoluteContentSize.Y + 20)
- end)
- -- Close Button
- local CloseBtn = Instance.new("TextButton")
- CloseBtn.Size = UDim2.new(0, 30, 0, 30)
- CloseBtn.Position = UDim2.new(1, -35, 0, 5)
- CloseBtn.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
- CloseBtn.Text = "X"
- CloseBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
- CloseBtn.Font = Enum.Font.GothamBold
- CloseBtn.TextSize = 14
- CloseBtn.Parent = TitleBar
- local cc = Instance.new("UICorner")
- cc.CornerRadius = UDim.new(0, 6)
- cc.Parent = CloseBtn
- CloseBtn.MouseButton1Click:Connect(function()
- ScreenGui:Destroy()
- getgenv().__GLEAVIN_LEVEL_LOADED = false
- end)
- -- Notification Popup
- local NotifyFrame = Instance.new("Frame")
- NotifyFrame.Size = UDim2.new(0, 200, 0, 40)
- NotifyFrame.Position = UDim2.new(0.5, -100, 0, 20)
- NotifyFrame.BackgroundColor3 = Color3.fromRGB(40, 150, 60)
- NotifyFrame.Parent = ScreenGui
- local nc = Instance.new("UICorner")
- nc.CornerRadius = UDim.new(0, 6)
- nc.Parent = NotifyFrame
- local NText = Instance.new("TextLabel")
- NText.Size = UDim2.new(1, 0, 1, 0)
- NText.BackgroundTransparency = 1
- NText.Text = "Gleavin Hub Loaded!"
- NText.TextColor3 = Color3.fromRGB(255, 255, 255)
- NText.Font = Enum.Font.GothamBold
- NText.Parent = NotifyFrame
- task.delay(3, function()
- NotifyFrame:Destroy()
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment