Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Gleavin Hub // Chest Farm
- Standalone chest farming script for Blox Fruits
- Rayfield UI
- Run one Gleavin Hub script at a time
- ]]
- if getgenv().__GLEAVIN_CHEST_LOADED then return end
- getgenv().__GLEAVIN_CHEST_LOADED = true
- -- ============================================================================
- -- RAYFIELD UI
- -- ============================================================================
- local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
- if not Rayfield then
- warn("[Gleavin] Rayfield failed to load")
- return
- end
- -- ============================================================================
- -- SERVICES
- -- ============================================================================
- local Players = game:GetService("Players")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local CollectionService = game:GetService("CollectionService")
- local VirtualInputManager = game:GetService("VirtualInputManager")
- local TweenService = game:GetService("TweenService")
- local HttpService = game:GetService("HttpService")
- local Lighting = game:GetService("Lighting")
- local LP = Players.LocalPlayer
- local t = LP
- local CommF = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("CommF_")
- getgenv().CheckPlaceId = game.PlaceId == 100117331123089 and 100117331123089 or 7449423635
- getgenv().CheckPlaceId2 = game.PlaceId == 4442272183 and 4442272183 or 79091703265657
- getgenv().CheckPlaceId3 = game.PlaceId == 2753915549 and 2753915549 or 85211729168715
- repeat task.wait() until game:IsLoaded() and LP:FindFirstChild("DataLoaded")
- -- ============================================================================
- -- SETTINGS PERSISTENCE
- -- ============================================================================
- local FolderName = "GleavinHub"
- if not isfolder(FolderName) then makefolder(FolderName) end
- local SaveFileName = FolderName .. "/ChestFarm.json"
- local Settings = {}
- local function SaveSettings(key, value)
- Settings[key] = value
- pcall(function()
- writefile(SaveFileName, HttpService:JSONEncode(Settings))
- end)
- end
- local function LoadSettings()
- local ok, data = pcall(function()
- return HttpService:JSONDecode(readfile(SaveFileName))
- end)
- if ok and type(data) == "table" then Settings = data end
- end
- LoadSettings()
- local function Notify(title, desc)
- pcall(function()
- Rayfield:Notify({
- Title = title or "Gleavin Hub",
- Content = desc or "",
- Duration = 5,
- Image = 4483362458
- })
- end)
- end
- -- ============================================================================
- -- TWEEN MANAGER (verbatim from source)
- -- ============================================================================
- local _l = TweenService
- getgenv().TweenManager = {
- currentTween = nil, currentPart = nil, currentGoal = nil, TweenRunning = false,
- CancelTweenOnly = function()
- local Q, S = getgenv().TweenManager.currentTween, getgenv().Tween
- if Q then pcall(function() Q:Cancel(); Q:Destroy() end) end
- if S and S ~= Q then pcall(function() S:Cancel(); S:Destroy() end) end
- getgenv().TweenManager.currentTween = nil
- getgenv().TweenManager.currentPart = nil
- getgenv().TweenManager.currentGoal = nil
- getgenv().TweenManager.TweenRunning = false
- getgenv().Tween = nil
- end,
- PlayTween = function(Q, S, L, d)
- if not Q or not S or not L or not L.CFrame then return end
- local I = (d or {}).TargetEpsilon or 12
- if getgenv().TweenManager.currentTween and getgenv().TweenManager.currentPart == Q
- and getgenv().TweenManager.currentGoal
- and I >= (getgenv().TweenManager.currentGoal.Position - L.CFrame.Position).Magnitude then
- return getgenv().TweenManager.currentTween
- end
- getgenv().TweenManager.CancelTweenOnly()
- local tw = _l:Create(Q, S, L)
- getgenv().TweenManager.currentTween = tw
- getgenv().TweenManager.currentPart = Q
- getgenv().TweenManager.currentGoal = L.CFrame
- getgenv().TweenManager.TweenRunning = true
- getgenv().Tween = tw
- tw.Completed:Connect(function()
- if getgenv().TweenManager.currentTween == tw then
- getgenv().TweenManager.currentTween = nil
- getgenv().TweenManager.currentPart = nil
- getgenv().TweenManager.currentGoal = nil
- getgenv().TweenManager.TweenRunning = false
- getgenv().Tween = nil
- pcall(function() tw:Destroy() end)
- end
- end)
- tw:Play()
- return tw
- end,
- CancelCurrent = function()
- local ch = t.Character
- local hrp = ch and ch:FindFirstChild("HumanoidRootPart")
- if getgenv().TweenManager.currentTween or getgenv().Tween or (hrp and hrp:FindFirstChild("FloatForce")) then
- getgenv().TweenManager.CancelTweenOnly()
- pcall(function()
- if not ch then return end
- for _, p in ipairs(ch:GetDescendants()) do
- if p:IsA("BasePart") then p.CanCollide = true end
- end
- local h = ch:FindFirstChildOfClass("Humanoid")
- if h then h.PlatformStand = false end
- if hrp and hrp:FindFirstChild("FloatForce") then hrp.FloatForce:Destroy() end
- end)
- end
- end,
- }
- TweenManager = getgenv().TweenManager
- -- ============================================================================
- -- toTarget (chest-farm scope)
- -- ============================================================================
- local _G_Tweening = false
- local ReadyToDodge = false
- local function AddFloatForce(hrp)
- if hrp:FindFirstChild("FloatForce") then return end
- local bv = Instance.new("BodyVelocity")
- bv.Name = "FloatForce"
- bv.Velocity = Vector3.new(0, 0, 0)
- bv.MaxForce = Vector3.new(100000, 100000, 100000)
- bv.P = 10000
- bv.Parent = hrp
- end
- 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")
- local hum = char:FindFirstChildOfClass("Humanoid")
- if not hrp or not hum then return end
- if hum.Sit then
- TweenManager.CancelCurrent()
- task.wait(0.1)
- VirtualInputManager:SendKeyEvent(true, "Space", false, game)
- task.wait()
- VirtualInputManager:SendKeyEvent(false, "Space", false, game)
- task.wait(0.1)
- if hrp:FindFirstChild("EffectsSY") then hrp.EffectsSY:Destroy() end
- hum.Jump = true
- task.wait(0.1)
- hrp.CFrame = hrp.CFrame * CFrame.new(0, 10, 0)
- return
- end
- AddFloatForce(hrp)
- local dist = (P.Position - hrp.Position).Magnitude
- if Settings["Teleport Y"] then
- local pct = Settings["% Health Player"] or 40
- local hp = hum.Health / hum.MaxHealth
- if hp < pct / 100 then _G_Tweening = true
- elseif hp > 0.8 then _G_Tweening = false end
- end
- if dist < (skipCheck and 8 or 150) and not _G_Tweening and not ReadyToDodge then
- TweenManager.CancelTweenOnly()
- hrp.CFrame = P
- return
- end
- if hrp.Position.Y < -60 and hrp.Position.Y > -100 then
- hrp.CFrame = hrp.CFrame * CFrame.new(0, 20, 0)
- end
- local offset = CFrame.new()
- if ReadyToDodge then offset = CFrame.new(0, 200, 0)
- elseif _G_Tweening then offset = CFrame.new(0, Settings["Distance Teleport Y"] or 800, 0) end
- local goal = P * offset
- local speed = Settings["Speed Tween "] or 300
- if (goal.Position - hrp.Position).Magnitude < 3 and not ReadyToDodge and not _G_Tweening then
- TweenManager.CancelTweenOnly()
- hrp.CFrame = goal
- return
- end
- TweenManager.PlayTween(hrp, TweenInfo.new(dist / speed, Enum.EasingStyle.Linear), { CFrame = goal })
- end
- getgenv().BackupTween = toTarget
- -- ============================================================================
- -- DETECTION
- -- ============================================================================
- function IsMobAlive(mob)
- return mob and mob.Parent
- and mob:FindFirstChild("HumanoidRootPart")
- and mob:FindFirstChildWhichIsA("Humanoid")
- and mob.Humanoid.Health > 0
- end
- function CheckNameBoss(nameOrList)
- for _, model in pairs(ReplicatedStorage:GetChildren()) do
- if (typeof(nameOrList) == "table" and table.find(nameOrList, model.Name) or model.Name == nameOrList)
- and IsMobAlive(model) then return model end
- end
- for _, model in pairs(workspace.Enemies:GetChildren()) do
- if (typeof(nameOrList) == "table" and table.find(nameOrList, model.Name) or model.Name == nameOrList)
- and IsMobAlive(model) then return model end
- end
- end
- function DetectItemPlr(name)
- if t.Character:FindFirstChild(name) or t.Backpack:FindFirstChild(name) then
- return true
- end
- end
- -- ============================================================================
- -- CHEST DETECTION (verbatim from source)
- -- ============================================================================
- function GetNearestChest()
- local best, bestDist = nil, math.huge
- for _, chest in pairs(CollectionService:GetTagged("_ChestTagged")) do
- if not chest:GetAttribute("IsDisabled") and not chest:FindFirstChild("Ignored") then
- local d = t:DistanceFromCharacter(chest.Position)
- if d < bestDist then bestDist, best = d, chest end
- end
- end
- return best
- end
- function PathFindChest()
- for _, model in pairs(workspace._WorldOrigin.PlayerSpawns.Pirates:GetChildren()) do
- if model:IsA("Model") and model:FindFirstChild("Part") and not model:FindFirstChild("Ignored") then
- return model
- end
- end
- end
- -- ============================================================================
- -- TIMER (Fist of Darkness / God's Chalice 4h spawn detection)
- -- ============================================================================
- function GetOldestLocation()
- local oldestTime, oldestLoc = math.huge, nil
- for _, loc in ipairs(workspace._WorldOrigin.Locations:GetChildren()) do
- local tIn = loc:GetAttribute("TimeIn")
- if tIn and tIn < oldestTime then
- oldestTime, oldestLoc = tIn, loc
- end
- end
- return oldestLoc
- end
- getgenv().GoCollectChest = false
- getgenv().ValueCollectChestSpawnGod = 0
- getgenv().NextSpawnSeconds = nil
- task.spawn(function()
- while task.wait(0.25) do
- pcall(function()
- local oldestLoc = GetOldestLocation()
- if oldestLoc then
- local timeIn = oldestLoc:GetAttribute("TimeIn")
- local elapsed = tick() - 25200 - timeIn
- local period = 14400
- local remaining = period - elapsed % period
- getgenv().NextSpawnSeconds = remaining
- local hh = math.floor(remaining / 3600)
- local mm = math.floor(remaining % 3600 / 60)
- local ss = math.floor(remaining % 60)
- if hh == 0 and mm == 0 and ss <= 5 then
- getgenv().GoCollectChest = true
- end
- end
- end)
- end
- end)
- -- ============================================================================
- -- SAFE ZONE (Tween Safe if have Items)
- -- ============================================================================
- task.spawn(function()
- while task.wait(0.25) do
- pcall(function()
- if not Settings["Tween Safe if have Items"] then return end
- if DetectItemPlr("Fist of Darkness") or DetectItemPlr("God's Chalice") then
- if game.PlaceId == getgenv().CheckPlaceId2 then
- toTarget(CFrame.new(-385.250916, 73.0458984, 297.388397))
- else
- toTarget(CFrame.new(-12463, 374, -7523))
- end
- end
- end)
- end
- end)
- -- ============================================================================
- -- HOP SERVER (verbatim from source)
- -- ============================================================================
- function CheckJobIdServer()
- local keys = {}
- local ok, data = pcall(function()
- return HttpService:JSONDecode(readfile(FolderName .. "/Jobid.json"))
- end)
- if ok and type(data) == "table" then
- for k in pairs(data) do table.insert(keys, k) end
- end
- return keys
- end
- function HopServer()
- Notify("Gleavin Hub", "Hop Server")
- for page = 1, 100 do
- for jobId in pairs(ReplicatedStorage.__ServerBrowser:InvokeServer(page)) do
- if jobId ~= game.JobId and not table.find(CheckJobIdServer(), jobId) then
- pcall(function()
- ReplicatedStorage.__ServerBrowser:InvokeServer("teleport", jobId)
- end)
- return
- end
- end
- end
- end
- -- ============================================================================
- -- COMBAT (minimal - only what's needed for defense while chest farming)
- -- ============================================================================
- local Mouse = require(ReplicatedStorage.Mouse)
- local CombatUtil = require(ReplicatedStorage.Modules.CombatUtil)
- local NetMod = require(ReplicatedStorage.Modules.Net)
- local RegisterAttack = NetMod:WaitForChild("RE/RegisterAttack")
- local RegisterHit = NetMod:RemoteEvent("RegisterHit", true)
- v_u_27 = 0
- v_u_28 = false
- v_u_33 = false
- v_u_31 = nil
- v_u_32 = 0
- v_u_21 = 0
- v_u_16 = 1
- local function AllTargets(includePlayers)
- local list = {}
- for _, v in pairs(workspace:WaitForChild("Enemies"):GetChildren()) do table.insert(list, v) end
- if includePlayers then
- for _, v in pairs(workspace:WaitForChild("Characters"):GetChildren()) do table.insert(list, v) end
- end
- return list
- end
- getgenv().getBladeHits = function(selfChar, origins, baseRadius, includePlayers)
- local hits = {}
- for _, mob in pairs(AllTargets(includePlayers)) do
- if mob:IsDescendantOf(Workspace) and mob ~= selfChar and mob:FindFirstChild("HumanoidRootPart") then
- local hrp = mob.HumanoidRootPart
- local radius = Players:GetPlayerFromCharacter(mob) and (baseRadius / 1.5) or baseRadius
- local points = { hrp.Position }
- if hrp.Size.Y > 5 then
- table.insert(points, (hrp.CFrame * CFrame.new(0, -hrp.Size.Y * 1.5 + 3, 0)).Position)
- end
- for _, pt in pairs(points) do
- if (pt - origins[1].Position).Magnitude < 10 + radius + hrp.Size.X / 2 then
- for _, part in pairs(mob:GetChildren()) do
- if part:IsA("BasePart") and (part.Position - origins[1].Position).Magnitude <= radius + hrp.Size.X / 2 then
- table.insert(hits, part)
- end
- end
- break
- end
- end
- end
- end
- return hits
- end
- local BODY_PARTS = {
- RightUpperArm = true, RightLowerArm = true, RightHand = true,
- RightUpperLeg = true, RightLowerLeg = true, RightFoot = true,
- LeftUpperArm = true, LeftLowerArm = true, LeftHand = true,
- LeftUpperLeg = true, LeftLowerLeg = true, LeftFoot = true,
- UpperTorso = true, LowerTorso = true, Head = true,
- }
- local function AttackAOE(radius, includePlayers)
- local found, seen = {}, {}
- local origins = { t.Character.HumanoidRootPart }
- for _, part in pairs(getgenv().getBladeHits(t.Character, origins, radius or 80, includePlayers)) do
- local rig = CombatUtil:GetRigOfHitPart(part)
- if rig and not seen[rig] and BODY_PARTS[part.Name] and CombatUtil:IsVulnerable(rig) then
- local summoner, selfSummoner = rig:FindFirstChild("Summoner"), t.Character:FindFirstChild("Summoner")
- if rig ~= t.Character
- and (not selfSummoner or rig ~= selfSummoner.Value.Character)
- and (not Players:GetPlayerFromCharacter(t.Character) or not summoner
- or summoner.Value ~= Players:GetPlayerFromCharacter(t.Character)) then
- table.insert(found, { rig, part })
- seen[rig] = true
- end
- end
- end
- return #found > 0 and found or nil
- end
- local function attackMelee(radius)
- local tool = t.Character:FindFirstChildOfClass("Tool")
- if not tool then return end
- local hits = AttackAOE(radius, false)
- if not hits then return end
- local hum = t.Character.Humanoid
- local root = hum and hum.RootPart
- root = root and root.Parent
- local anims = CombatUtil:GetMovesetAnimCache(hum)
- if anims then
- local weaponName = CombatUtil:GetWeaponName(tool)
- local data = CombatUtil:GetWeaponData(weaponName)
- local weaponType, moveset = data.WeaponType, data.Moveset
- if CombatUtil:CanAttack(root, weaponType) then
- v_u_33 = true; v_u_32 = 5; v_u_21 = os.clock()
- v_u_27 += 1
- if v_u_27 > #moveset.Basic then v_u_27 = 1 end
- local anim = anims[CombatUtil:GetPureWeaponName(weaponName) .. "-basic" .. v_u_27]
- RegisterAttack:FireServer(anim.Length / (anim:GetAttribute("SpeedMult") or 1))
- RegisterHit:FireServer(table.remove(hits, 1)[2], hits)
- anim:Play(0.1, 1, 1 * (anim:GetAttribute("SpeedMult") or 1))
- v_u_28 = true
- task.delay(anim.Length / (anim:GetAttribute("SpeedMult") or 1) * v_u_16, function()
- v_u_28 = false
- end)
- v_u_31 = anim
- table.clear(hits)
- end
- end
- end
- function AttackFunction(radius)
- if t.Character.Stun.Value ~= 0 then return end
- if not Settings["Attack No Animation "] then
- attackMelee(radius)
- else
- local hits = AttackAOE(radius, false)
- if not hits then return end
- RegisterAttack:FireServer(0)
- RegisterHit:FireServer(table.remove(hits, 1)[2], hits)
- table.clear(hits)
- 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 equiptool(name)
- if name and t:FindFirstChild("Backpack") and t.Backpack:FindFirstChild(name) and not t.Character.Humanoid.Sit then
- t.Character.Humanoid:EquipTool(t.Backpack:FindFirstChild(name))
- end
- end
- function ClickM1(mob, isBoat)
- if not (t.Character and t.Character:FindFirstChild("HumanoidRootPart")
- and mob and mob:FindFirstChild("HumanoidRootPart")
- and mob.Humanoid.Health > 0
- and (t.Character.HumanoidRootPart.Position - mob.HumanoidRootPart.Position).Magnitude < 70) then
- return
- end
- if Settings["Select 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
- local seq = math.random(1, 5)
- fruitTool.LeftClickRemote:FireServer(lookDir, seq)
- return
- end
- end
- AttackFunction(isBoat and 80 or 30)
- end
- -- ============================================================================
- -- FAST ATTACK (verbatim PASS32 pattern)
- -- ============================================================================
- local CombatFrameworkR = nil
- pcall(function()
- local cfMod = require(t.PlayerScripts:WaitForChild("CombatFramework"))
- local ups = debug.getupvalues(cfMod)
- CombatFrameworkR = ups and ups[2]
- end)
- pcall(function()
- local shaker = require(ReplicatedStorage.Util.CameraShaker)
- if shaker and shaker.Stop then shaker:Stop() end
- end)
- local function FastAttackOnce()
- if not (getgenv().Usefastattack or getgenv().SuperFastAttack) then return end
- if not CombatFrameworkR then return end
- local controller = CombatFrameworkR.activeController
- if not controller then return end
- pcall(function()
- controller.hitboxMagnitude = getgenv().SuperFastAttack and 60 or 55
- controller.timeToNextAttack = 0
- controller.attacking = false
- controller.increment = 3
- controller.blocking = false
- controller.timeToNextBlock = 0
- if controller.attack then controller:attack() end
- local hum = t.Character and t.Character:FindFirstChildOfClass("Humanoid")
- if hum then hum.Sit = false end
- end)
- end
- task.spawn(function()
- while task.wait() do
- if getgenv().Usefastattack or getgenv().SuperFastAttack then
- FastAttackOnce()
- end
- end
- end)
- -- ============================================================================
- -- AUTO CHEST (verbatim from source with StackFarmOther defaulted true)
- -- ============================================================================
- getgenv().StackFarmOther = true
- local chestCount = 0
- function AutoChest()
- if not getgenv().StackFarmOther then return end
- local limit = Settings["Value Collect Chest to Hop"] or 20
- if Settings["Attack Darkbeard"] and CheckNameBoss("Darkbeard") then
- chestCount = limit; return
- end
- if Settings["Summon Darkbeard"] and DetectItemPlr("Fist of Darkness") then
- chestCount = limit; return
- end
- if (DetectItemPlr("Fist of Darkness") or DetectItemPlr("God's Chalice"))
- and Settings["Tween Safe if have Items"] then return end
- if chestCount >= limit and Settings["Auto Chest Hop"] then
- HopServer()
- return
- end
- local chest = GetNearestChest()
- if chest then
- chestCount += 1
- local stuckT
- repeat
- task.wait()
- if (t.Character.HumanoidRootPart.Position - chest.Position).Magnitude <= 5 then
- if not stuckT then stuckT = tick()
- elseif tick() - stuckT >= 5 then
- Instance.new("IntValue", chest).Name = "Ignored"
- task.wait(0.1)
- end
- if not Settings["Use Method Teleport"] then
- VirtualInputManager:SendKeyEvent(true, "Space", false, game)
- task.wait()
- VirtualInputManager:SendKeyEvent(false, "Space", false, game)
- end
- TweenManager.CancelCurrent()
- end
- if Settings["Use Method Teleport"] then
- t.Character.HumanoidRootPart.CFrame = chest.CFrame
- TweenManager.CancelCurrent()
- else
- toTarget(chest.CFrame, true)
- end
- until not chest
- or not chest.Parent
- or not Settings["Auto Chest"]
- or chest:GetAttribute("IsDisabled")
- or chest:FindFirstChild("Ignored")
- or not chest:FindFirstChild("TouchInterest")
- or not getgenv().StackFarmOther
- else
- local pathChest = PathFindChest()
- if pathChest then
- toTarget(pathChest.Part.CFrame)
- if (pathChest.Part.Position - t.Character.HumanoidRootPart.Position).Magnitude <= 100
- or GetNearestChest() then
- Instance.new("IntValue", pathChest).Name = "Ignored"
- end
- else
- for _, v in pairs(workspace._WorldOrigin.PlayerSpawns.Pirates:GetChildren()) do
- if v:FindFirstChild("Ignored") then v.Ignored:Destroy() end
- end
- end
- end
- end
- -- Auto Chest toggle loop
- task.spawn(function()
- while task.wait(0.1) do
- pcall(function()
- if Settings["Auto Chest"] then
- AutoChest()
- end
- end)
- end
- end)
- -- Collect Chest When Server Spawn loop
- task.spawn(function()
- while task.wait() do
- pcall(function()
- if not Settings["Collect Chest When Server Spawn God's Chalice or Fist of Darkness"] then return end
- if not getgenv().GoCollectChest then return end
- if getgenv().ValueCollectChestSpawnGod >= 10 then
- getgenv().GoCollectChest = false
- getgenv().ValueCollectChestSpawnGod = 0
- return
- end
- local chest = GetNearestChest()
- if chest then
- getgenv().ValueCollectChestSpawnGod += 1
- local stuckT
- repeat
- task.wait()
- if (t.Character.HumanoidRootPart.Position - chest.Position).Magnitude <= 5 then
- if not stuckT then stuckT = tick()
- elseif tick() - stuckT >= 5 then
- Instance.new("IntValue", chest).Name = "Ignored"
- task.wait(0.1)
- end
- if not Settings["Use Method Teleport"] then
- VirtualInputManager:SendKeyEvent(true, "Space", false, game)
- task.wait()
- VirtualInputManager:SendKeyEvent(false, "Space", false, game)
- end
- TweenManager.CancelCurrent()
- end
- if Settings["Use Method Teleport"] then
- t.Character.HumanoidRootPart.CFrame = chest.CFrame
- TweenManager.CancelCurrent()
- else
- toTarget(chest.CFrame, true)
- end
- until not chest
- or not chest.Parent
- or not Settings["Collect Chest When Server Spawn God's Chalice or Fist of Darkness"]
- or chest:GetAttribute("IsDisabled")
- or chest:FindFirstChild("Ignored")
- or not chest:FindFirstChild("TouchInterest")
- return
- else
- local pathChest = PathFindChest()
- if pathChest then
- toTarget(pathChest.Part.CFrame)
- if (pathChest.Part.Position - t.Character.HumanoidRootPart.Position).Magnitude <= 100
- or GetNearestChest() then
- Instance.new("IntValue", pathChest).Name = "Ignored"
- end
- else
- for _, v in pairs(workspace._WorldOrigin.PlayerSpawns.Pirates:GetChildren()) do
- if v:FindFirstChild("Ignored") then v.Ignored:Destroy() end
- end
- end
- end
- end)
- end
- end)
- -- ============================================================================
- -- NOCLIP
- -- ============================================================================
- task.spawn(function()
- while task.wait() do
- if Settings["Noclip"] then
- pcall(function()
- local char = t.Character
- if char then
- for _, part in pairs(char:GetDescendants()) do
- if (part:IsA("MeshPart") or part:IsA("Part")) and part.CanCollide then
- part.CanCollide = false
- end
- end
- end
- end)
- end
- end
- end)
- -- ============================================================================
- -- AUTO REJOIN
- -- ============================================================================
- task.spawn(function()
- while task.wait(2) do
- pcall(function()
- if Settings["Auto rejoin Disconnect"] then
- local errorPrompt = game:GetService("CoreGui"):FindFirstChild("RobloxPromptGui")
- if errorPrompt and errorPrompt:FindFirstChild("promptOverlay") then
- local msg = errorPrompt.promptOverlay:FindFirstChild("ErrorPrompt")
- if msg and msg:FindFirstChild("MessageArea") and msg.MessageArea:FindFirstChild("ErrorFrame") then
- local text = msg.MessageArea.ErrorFrame:FindFirstChild("ErrorMessage")
- if text and not string.find(text.Text, "Teleport") then
- game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId, game.JobId, t)
- end
- end
- end
- end
- end)
- end
- end)
- -- ============================================================================
- -- AIMHOOK (only when chest loop active + combat needed)
- -- ============================================================================
- do
- local mt = getrawmetatable(game)
- local oldNamecall = mt.__namecall
- setreadonly(mt, false)
- mt.__namecall = newcclosure(function(self, ...)
- local method = getnamecallmethod()
- local args = { ... }
- local aimPos = getgenv().AimPos
- if method == "FireServer" and self.Name == "RemoteEvent" and aimPos
- and tostring(aimPos.X) ~= "nan"
- and (Settings["Auto Chest"] or getgenv().Usefastattack) then
- if #args == 1 and typeof(args[1]) == "Vector3" then
- args[1] = aimPos.Position
- elseif #args == 1 and typeof(args[1]) == "CFrame" then
- args[1] = aimPos
- end
- end
- return oldNamecall(self, unpack(args))
- end)
- setreadonly(mt, true)
- end
- -- ============================================================================
- -- RAYFIELD UI
- -- ============================================================================
- local Window = Rayfield:CreateWindow({
- Name = "Gleavin Hub // Chest Farm",
- LoadingTitle = "Gleavin Hub",
- LoadingSubtitle = "Chest Farm",
- Theme = "Default",
- ConfigurationSaving = {
- Enabled = true,
- FolderName = "GleavinHub",
- FileName = "ChestFarmConfig"
- },
- KeySystem = false,
- })
- -- =========== TAB 1: CHEST ===========
- local ChestTab = Window:CreateTab("Chest", 4483362458)
- ChestTab:CreateSection("Main Loop")
- ChestTab:CreateToggle({
- Name = "Auto Chest",
- CurrentValue = Settings["Auto Chest"] or false,
- Flag = "AutoChestFlag",
- Callback = function(v)
- Settings["Auto Chest"] = v
- SaveSettings("Auto Chest", v)
- end,
- })
- ChestTab:CreateToggle({
- Name = "Auto Chest Hop",
- CurrentValue = Settings["Auto Chest Hop"] or false,
- Flag = "AutoChestHopFlag",
- Callback = function(v)
- Settings["Auto Chest Hop"] = v
- SaveSettings("Auto Chest Hop", v)
- end,
- })
- ChestTab:CreateSlider({
- Name = "Value Collect Chest to Hop",
- Range = { 0, 100 },
- Increment = 1,
- Suffix = "chests",
- CurrentValue = Settings["Value Collect Chest to Hop"] or 20,
- Flag = "ValueHopFlag",
- Callback = function(v)
- Settings["Value Collect Chest to Hop"] = v
- SaveSettings("Value Collect Chest to Hop", v)
- end,
- })
- ChestTab:CreateToggle({
- Name = "Use Method Teleport",
- CurrentValue = Settings["Use Method Teleport"] or false,
- Flag = "UseTpFlag",
- Callback = function(v)
- Settings["Use Method Teleport"] = v
- SaveSettings("Use Method Teleport", v)
- end,
- })
- ChestTab:CreateSection("Special Spawn (4h Fist of Darkness / God's Chalice)")
- ChestTab:CreateToggle({
- Name = "Collect Chest When Server Spawn God's Chalice / Fist of Darkness",
- CurrentValue = Settings["Collect Chest When Server Spawn God's Chalice or Fist of Darkness"] or false,
- Flag = "CollectSpecialFlag",
- Callback = function(v)
- Settings["Collect Chest When Server Spawn God's Chalice or Fist of Darkness"] = v
- SaveSettings("Collect Chest When Server Spawn God's Chalice or Fist of Darkness", v)
- end,
- })
- ChestTab:CreateSection("Item Safety")
- ChestTab:CreateToggle({
- Name = "Tween Safe if have Items",
- CurrentValue = Settings["Tween Safe if have Items"] or false,
- Flag = "SafeItemsFlag",
- Callback = function(v)
- Settings["Tween Safe if have Items"] = v
- SaveSettings("Tween Safe if have Items", v)
- end,
- })
- -- =========== TAB 2: STATUS ===========
- local StatusTab = Window:CreateTab("Status", 4483362458)
- StatusTab:CreateSection("Server Timer")
- local timerParagraph = StatusTab:CreateParagraph({
- Title = "Next Fist of Darkness / God's Chalice Spawn",
- Content = "calculating..."
- })
- StatusTab:CreateSection("Collect Status")
- local collectParagraph = StatusTab:CreateParagraph({
- Title = "Collect Status",
- Content = "Idle"
- })
- task.spawn(function()
- while task.wait(1) do
- pcall(function()
- local remaining = getgenv().NextSpawnSeconds
- if remaining then
- local hh = math.floor(remaining / 3600)
- local mm = math.floor(remaining % 3600 / 60)
- local ss = math.floor(remaining % 60)
- timerParagraph:Set({
- Title = "Next Fist of Darkness / God's Chalice Spawn",
- Content = string.format("%02d:%02d:%02d", hh, mm, ss)
- })
- else
- timerParagraph:Set({
- Title = "Next Fist of Darkness / God's Chalice Spawn",
- Content = "no data — join a server with world origin loaded"
- })
- end
- if getgenv().GoCollectChest then
- collectParagraph:Set({
- Title = "Collect Status",
- Content = "RUSHING to spawn chest — " .. getgenv().ValueCollectChestSpawnGod .. "/10"
- })
- elseif Settings["Collect Chest When Server Spawn God's Chalice or Fist of Darkness"] then
- collectParagraph:Set({
- Title = "Collect Status",
- Content = "Armed — waiting for 4h spawn"
- })
- else
- collectParagraph:Set({
- Title = "Collect Status",
- Content = "Idle"
- })
- end
- end)
- end
- end)
- -- =========== TAB 3: COMBAT ===========
- local CombatTab = Window:CreateTab("Combat", 4483362458)
- CombatTab:CreateSection("Defense")
- CombatTab:CreateDropdown({
- Name = "Select Weapon",
- Options = { "Melee", "Sword", "Blox Fruit" },
- CurrentOption = Settings["Select Weapon"] or "Melee",
- MultipleOptions = false,
- Flag = "WeaponFlag",
- Callback = function(v)
- local m = type(v) == "table" and v[1] or v
- Settings["Select Weapon"] = m
- SaveSettings("Select Weapon", m)
- end,
- })
- CombatTab:CreateToggle({
- Name = "Attack No Animation",
- CurrentValue = Settings["Attack No Animation "] == true,
- Flag = "NoAnimFlag",
- Callback = function(v)
- Settings["Attack No Animation "] = v
- SaveSettings("Attack No Animation ", v)
- end,
- })
- CombatTab:CreateToggle({
- Name = "Fast Attack",
- CurrentValue = Settings["Fast Attack"] or false,
- Flag = "FastAttackFlag",
- Callback = function(v)
- getgenv().Usefastattack = v
- getgenv().fastattect = v
- SaveSettings("Fast Attack", v)
- end,
- })
- CombatTab:CreateToggle({
- Name = "Super Fast Attack",
- CurrentValue = Settings["Super Fast Attack"] or false,
- Flag = "SuperFastFlag",
- Callback = function(v)
- getgenv().SuperFastAttack = v
- if v then
- getgenv().Usefastattack = true
- getgenv().fastattect = true
- end
- SaveSettings("Super Fast Attack", v)
- end,
- })
- -- =========== TAB 4: MOVEMENT ===========
- local MoveTab = Window:CreateTab("Movement", 4483362458)
- MoveTab:CreateSection("Tween")
- MoveTab:CreateSlider({
- Name = "Speed Tween",
- Range = { 0, 1000 },
- Increment = 10,
- Suffix = "studs/s",
- CurrentValue = Settings["Speed Tween "] or 300,
- Flag = "SpeedTweenFlag",
- Callback = function(v)
- Settings["Speed Tween "] = v
- SaveSettings("Speed Tween ", v)
- end,
- })
- MoveTab:CreateToggle({
- Name = "Noclip",
- CurrentValue = Settings["Noclip"] or false,
- Flag = "NoclipFlag",
- Callback = function(v)
- Settings["Noclip"] = v
- SaveSettings("Noclip", v)
- end,
- })
- MoveTab:CreateSection("Health Safety")
- MoveTab:CreateToggle({
- Name = "Teleport Y if low health",
- CurrentValue = Settings["Teleport Y"] or false,
- Flag = "TeleportYFlag",
- Callback = function(v)
- Settings["Teleport Y"] = v
- SaveSettings("Teleport Y", v)
- end,
- })
- MoveTab:CreateSlider({
- Name = "Health % Threshold",
- Range = { 0, 100 },
- Increment = 1,
- Suffix = "%",
- CurrentValue = Settings["% Health Player"] or 40,
- Flag = "HPThresholdFlag",
- Callback = function(v)
- Settings["% Health Player"] = v
- SaveSettings("% Health Player", v)
- end,
- })
- MoveTab:CreateSlider({
- Name = "Y Teleport Distance",
- Range = { 0, 10000 },
- Increment = 50,
- Suffix = "studs",
- CurrentValue = Settings["Distance Teleport Y"] or 800,
- Flag = "DistanceYFlag",
- Callback = function(v)
- Settings["Distance Teleport Y"] = v
- SaveSettings("Distance Teleport Y", v)
- end,
- })
- -- =========== TAB 5: SERVER ===========
- local ServerTab = Window:CreateTab("Server", 4483362458)
- ServerTab:CreateSection("Hop")
- ServerTab:CreateButton({
- Name = "Hop Server",
- Callback = function()
- HopServer()
- end,
- })
- ServerTab:CreateToggle({
- Name = "Auto Rejoin Disconnect",
- CurrentValue = Settings["Auto rejoin Disconnect"] or false,
- Flag = "RejoinFlag",
- Callback = function(v)
- Settings["Auto rejoin Disconnect"] = v
- SaveSettings("Auto rejoin Disconnect", v)
- end,
- })
- ServerTab:CreateSection("Info")
- ServerTab:CreateParagraph({
- Title = "PlaceId",
- Content = "current: " .. tostring(game.PlaceId)
- })
- -- =========== TAB 6: INFO ===========
- local InfoTab = Window:CreateTab("Info", 4483362458)
- InfoTab:CreateSection("Gleavin Hub // Chest Farm")
- InfoTab:CreateParagraph({
- Title = "How to use",
- Content = "1. Toggle Auto Chest (Chest tab)\n" ..
- "2. Optional: enable Auto Chest Hop + set Value Collect to Hop\n" ..
- "3. For the 4-hour Fist of Darkness / God's Chalice spawn:\n" ..
- " - Toggle Collect Chest When Server Spawn\n" ..
- " - Watch the Status tab for the countdown\n" ..
- " - When timer hits 00:00:00, bot auto-rushes the chest\n" ..
- "4. If you hold FoD or God's Chalice:\n" ..
- " - Enable Tween Safe if have Items\n" ..
- " - Bot teleports to safe zone until you do something with it\n\n" ..
- "Do not run two Gleavin Hub scripts at once.",
- })
- InfoTab:CreateSection("Chest Farm Mechanics")
- InfoTab:CreateParagraph({
- Title = "Behavior",
- Content = "• Auto Chest walks to nearest unignored chest\n" ..
- "• If no chest tagged, walks to pirate spawns\n" ..
- "• Marks chest as Ignored after 5s stuck (prevents loop)\n" ..
- "• Hop Server skips jobs you've visited\n" ..
- "• Collect Chest priority overrides Auto Chest when 4h timer hits",
- })
- InfoTab:CreateButton({
- Name = "Unload Gleavin Hub",
- Callback = function()
- getgenv().__GLEAVIN_CHEST_LOADED = false
- if Rayfield and Rayfield.Destroy then Rayfield:Destroy() end
- end,
- })
- -- ============================================================================
- -- INITIALIZE
- -- ============================================================================
- Rayfield:LoadConfiguration()
- Notify("Gleavin Hub", "Chest Farm loaded")
Advertisement