Geavin

Chest farm

Oct 21st, 2026
11
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.98 KB | None | 0 0
  1. --[[
  2. Gleavin Hub // Chest Farm
  3. Standalone chest farming script for Blox Fruits
  4. Rayfield UI
  5. Run one Gleavin Hub script at a time
  6. ]]
  7.  
  8. if getgenv().__GLEAVIN_CHEST_LOADED then return end
  9. getgenv().__GLEAVIN_CHEST_LOADED = true
  10.  
  11. -- ============================================================================
  12. -- RAYFIELD UI
  13. -- ============================================================================
  14. local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
  15. if not Rayfield then
  16. warn("[Gleavin] Rayfield failed to load")
  17. return
  18. end
  19.  
  20. -- ============================================================================
  21. -- SERVICES
  22. -- ============================================================================
  23. local Players = game:GetService("Players")
  24. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  25. local CollectionService = game:GetService("CollectionService")
  26. local VirtualInputManager = game:GetService("VirtualInputManager")
  27. local TweenService = game:GetService("TweenService")
  28. local HttpService = game:GetService("HttpService")
  29. local Lighting = game:GetService("Lighting")
  30. local LP = Players.LocalPlayer
  31. local t = LP
  32.  
  33. local CommF = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("CommF_")
  34.  
  35. getgenv().CheckPlaceId = game.PlaceId == 100117331123089 and 100117331123089 or 7449423635
  36. getgenv().CheckPlaceId2 = game.PlaceId == 4442272183 and 4442272183 or 79091703265657
  37. getgenv().CheckPlaceId3 = game.PlaceId == 2753915549 and 2753915549 or 85211729168715
  38.  
  39. repeat task.wait() until game:IsLoaded() and LP:FindFirstChild("DataLoaded")
  40.  
  41. -- ============================================================================
  42. -- SETTINGS PERSISTENCE
  43. -- ============================================================================
  44. local FolderName = "GleavinHub"
  45. if not isfolder(FolderName) then makefolder(FolderName) end
  46. local SaveFileName = FolderName .. "/ChestFarm.json"
  47.  
  48. local Settings = {}
  49. local function SaveSettings(key, value)
  50. Settings[key] = value
  51. pcall(function()
  52. writefile(SaveFileName, HttpService:JSONEncode(Settings))
  53. end)
  54. end
  55. local function LoadSettings()
  56. local ok, data = pcall(function()
  57. return HttpService:JSONDecode(readfile(SaveFileName))
  58. end)
  59. if ok and type(data) == "table" then Settings = data end
  60. end
  61. LoadSettings()
  62.  
  63. local function Notify(title, desc)
  64. pcall(function()
  65. Rayfield:Notify({
  66. Title = title or "Gleavin Hub",
  67. Content = desc or "",
  68. Duration = 5,
  69. Image = 4483362458
  70. })
  71. end)
  72. end
  73.  
  74. -- ============================================================================
  75. -- TWEEN MANAGER (verbatim from source)
  76. -- ============================================================================
  77. local _l = TweenService
  78. getgenv().TweenManager = {
  79. currentTween = nil, currentPart = nil, currentGoal = nil, TweenRunning = false,
  80. CancelTweenOnly = function()
  81. local Q, S = getgenv().TweenManager.currentTween, getgenv().Tween
  82. if Q then pcall(function() Q:Cancel(); Q:Destroy() end) end
  83. if S and S ~= Q then pcall(function() S:Cancel(); S:Destroy() end) end
  84. getgenv().TweenManager.currentTween = nil
  85. getgenv().TweenManager.currentPart = nil
  86. getgenv().TweenManager.currentGoal = nil
  87. getgenv().TweenManager.TweenRunning = false
  88. getgenv().Tween = nil
  89. end,
  90. PlayTween = function(Q, S, L, d)
  91. if not Q or not S or not L or not L.CFrame then return end
  92. local I = (d or {}).TargetEpsilon or 12
  93. if getgenv().TweenManager.currentTween and getgenv().TweenManager.currentPart == Q
  94. and getgenv().TweenManager.currentGoal
  95. and I >= (getgenv().TweenManager.currentGoal.Position - L.CFrame.Position).Magnitude then
  96. return getgenv().TweenManager.currentTween
  97. end
  98. getgenv().TweenManager.CancelTweenOnly()
  99. local tw = _l:Create(Q, S, L)
  100. getgenv().TweenManager.currentTween = tw
  101. getgenv().TweenManager.currentPart = Q
  102. getgenv().TweenManager.currentGoal = L.CFrame
  103. getgenv().TweenManager.TweenRunning = true
  104. getgenv().Tween = tw
  105. tw.Completed:Connect(function()
  106. if getgenv().TweenManager.currentTween == tw then
  107. getgenv().TweenManager.currentTween = nil
  108. getgenv().TweenManager.currentPart = nil
  109. getgenv().TweenManager.currentGoal = nil
  110. getgenv().TweenManager.TweenRunning = false
  111. getgenv().Tween = nil
  112. pcall(function() tw:Destroy() end)
  113. end
  114. end)
  115. tw:Play()
  116. return tw
  117. end,
  118. CancelCurrent = function()
  119. local ch = t.Character
  120. local hrp = ch and ch:FindFirstChild("HumanoidRootPart")
  121. if getgenv().TweenManager.currentTween or getgenv().Tween or (hrp and hrp:FindFirstChild("FloatForce")) then
  122. getgenv().TweenManager.CancelTweenOnly()
  123. pcall(function()
  124. if not ch then return end
  125. for _, p in ipairs(ch:GetDescendants()) do
  126. if p:IsA("BasePart") then p.CanCollide = true end
  127. end
  128. local h = ch:FindFirstChildOfClass("Humanoid")
  129. if h then h.PlatformStand = false end
  130. if hrp and hrp:FindFirstChild("FloatForce") then hrp.FloatForce:Destroy() end
  131. end)
  132. end
  133. end,
  134. }
  135. TweenManager = getgenv().TweenManager
  136.  
  137. -- ============================================================================
  138. -- toTarget (chest-farm scope)
  139. -- ============================================================================
  140. local _G_Tweening = false
  141. local ReadyToDodge = false
  142.  
  143. local function AddFloatForce(hrp)
  144. if hrp:FindFirstChild("FloatForce") then return end
  145. local bv = Instance.new("BodyVelocity")
  146. bv.Name = "FloatForce"
  147. bv.Velocity = Vector3.new(0, 0, 0)
  148. bv.MaxForce = Vector3.new(100000, 100000, 100000)
  149. bv.P = 10000
  150. bv.Parent = hrp
  151. end
  152.  
  153. function toTarget(P, skipCheck)
  154. if typeof(P) ~= "CFrame" then return end
  155. local char = t.Character
  156. if not char then return end
  157. local hrp = char:FindFirstChild("HumanoidRootPart")
  158. local hum = char:FindFirstChildOfClass("Humanoid")
  159. if not hrp or not hum then return end
  160.  
  161. if hum.Sit then
  162. TweenManager.CancelCurrent()
  163. task.wait(0.1)
  164. VirtualInputManager:SendKeyEvent(true, "Space", false, game)
  165. task.wait()
  166. VirtualInputManager:SendKeyEvent(false, "Space", false, game)
  167. task.wait(0.1)
  168. if hrp:FindFirstChild("EffectsSY") then hrp.EffectsSY:Destroy() end
  169. hum.Jump = true
  170. task.wait(0.1)
  171. hrp.CFrame = hrp.CFrame * CFrame.new(0, 10, 0)
  172. return
  173. end
  174.  
  175. AddFloatForce(hrp)
  176.  
  177. local dist = (P.Position - hrp.Position).Magnitude
  178.  
  179. if Settings["Teleport Y"] then
  180. local pct = Settings["% Health Player"] or 40
  181. local hp = hum.Health / hum.MaxHealth
  182. if hp < pct / 100 then _G_Tweening = true
  183. elseif hp > 0.8 then _G_Tweening = false end
  184. end
  185.  
  186. if dist < (skipCheck and 8 or 150) and not _G_Tweening and not ReadyToDodge then
  187. TweenManager.CancelTweenOnly()
  188. hrp.CFrame = P
  189. return
  190. end
  191.  
  192. if hrp.Position.Y < -60 and hrp.Position.Y > -100 then
  193. hrp.CFrame = hrp.CFrame * CFrame.new(0, 20, 0)
  194. end
  195.  
  196. local offset = CFrame.new()
  197. if ReadyToDodge then offset = CFrame.new(0, 200, 0)
  198. elseif _G_Tweening then offset = CFrame.new(0, Settings["Distance Teleport Y"] or 800, 0) end
  199. local goal = P * offset
  200. local speed = Settings["Speed Tween "] or 300
  201.  
  202. if (goal.Position - hrp.Position).Magnitude < 3 and not ReadyToDodge and not _G_Tweening then
  203. TweenManager.CancelTweenOnly()
  204. hrp.CFrame = goal
  205. return
  206. end
  207.  
  208. TweenManager.PlayTween(hrp, TweenInfo.new(dist / speed, Enum.EasingStyle.Linear), { CFrame = goal })
  209. end
  210. getgenv().BackupTween = toTarget
  211.  
  212. -- ============================================================================
  213. -- DETECTION
  214. -- ============================================================================
  215. function IsMobAlive(mob)
  216. return mob and mob.Parent
  217. and mob:FindFirstChild("HumanoidRootPart")
  218. and mob:FindFirstChildWhichIsA("Humanoid")
  219. and mob.Humanoid.Health > 0
  220. end
  221.  
  222. function CheckNameBoss(nameOrList)
  223. for _, model in pairs(ReplicatedStorage:GetChildren()) do
  224. if (typeof(nameOrList) == "table" and table.find(nameOrList, model.Name) or model.Name == nameOrList)
  225. and IsMobAlive(model) then return model end
  226. end
  227. for _, model in pairs(workspace.Enemies:GetChildren()) do
  228. if (typeof(nameOrList) == "table" and table.find(nameOrList, model.Name) or model.Name == nameOrList)
  229. and IsMobAlive(model) then return model end
  230. end
  231. end
  232.  
  233. function DetectItemPlr(name)
  234. if t.Character:FindFirstChild(name) or t.Backpack:FindFirstChild(name) then
  235. return true
  236. end
  237. end
  238.  
  239. -- ============================================================================
  240. -- CHEST DETECTION (verbatim from source)
  241. -- ============================================================================
  242. function GetNearestChest()
  243. local best, bestDist = nil, math.huge
  244. for _, chest in pairs(CollectionService:GetTagged("_ChestTagged")) do
  245. if not chest:GetAttribute("IsDisabled") and not chest:FindFirstChild("Ignored") then
  246. local d = t:DistanceFromCharacter(chest.Position)
  247. if d < bestDist then bestDist, best = d, chest end
  248. end
  249. end
  250. return best
  251. end
  252.  
  253. function PathFindChest()
  254. for _, model in pairs(workspace._WorldOrigin.PlayerSpawns.Pirates:GetChildren()) do
  255. if model:IsA("Model") and model:FindFirstChild("Part") and not model:FindFirstChild("Ignored") then
  256. return model
  257. end
  258. end
  259. end
  260.  
  261. -- ============================================================================
  262. -- TIMER (Fist of Darkness / God's Chalice 4h spawn detection)
  263. -- ============================================================================
  264. function GetOldestLocation()
  265. local oldestTime, oldestLoc = math.huge, nil
  266. for _, loc in ipairs(workspace._WorldOrigin.Locations:GetChildren()) do
  267. local tIn = loc:GetAttribute("TimeIn")
  268. if tIn and tIn < oldestTime then
  269. oldestTime, oldestLoc = tIn, loc
  270. end
  271. end
  272. return oldestLoc
  273. end
  274.  
  275. getgenv().GoCollectChest = false
  276. getgenv().ValueCollectChestSpawnGod = 0
  277. getgenv().NextSpawnSeconds = nil
  278.  
  279. task.spawn(function()
  280. while task.wait(0.25) do
  281. pcall(function()
  282. local oldestLoc = GetOldestLocation()
  283. if oldestLoc then
  284. local timeIn = oldestLoc:GetAttribute("TimeIn")
  285. local elapsed = tick() - 25200 - timeIn
  286. local period = 14400
  287. local remaining = period - elapsed % period
  288. getgenv().NextSpawnSeconds = remaining
  289. local hh = math.floor(remaining / 3600)
  290. local mm = math.floor(remaining % 3600 / 60)
  291. local ss = math.floor(remaining % 60)
  292. if hh == 0 and mm == 0 and ss <= 5 then
  293. getgenv().GoCollectChest = true
  294. end
  295. end
  296. end)
  297. end
  298. end)
  299.  
  300. -- ============================================================================
  301. -- SAFE ZONE (Tween Safe if have Items)
  302. -- ============================================================================
  303. task.spawn(function()
  304. while task.wait(0.25) do
  305. pcall(function()
  306. if not Settings["Tween Safe if have Items"] then return end
  307. if DetectItemPlr("Fist of Darkness") or DetectItemPlr("God's Chalice") then
  308. if game.PlaceId == getgenv().CheckPlaceId2 then
  309. toTarget(CFrame.new(-385.250916, 73.0458984, 297.388397))
  310. else
  311. toTarget(CFrame.new(-12463, 374, -7523))
  312. end
  313. end
  314. end)
  315. end
  316. end)
  317.  
  318. -- ============================================================================
  319. -- HOP SERVER (verbatim from source)
  320. -- ============================================================================
  321. function CheckJobIdServer()
  322. local keys = {}
  323. local ok, data = pcall(function()
  324. return HttpService:JSONDecode(readfile(FolderName .. "/Jobid.json"))
  325. end)
  326. if ok and type(data) == "table" then
  327. for k in pairs(data) do table.insert(keys, k) end
  328. end
  329. return keys
  330. end
  331.  
  332. function HopServer()
  333. Notify("Gleavin Hub", "Hop Server")
  334. for page = 1, 100 do
  335. for jobId in pairs(ReplicatedStorage.__ServerBrowser:InvokeServer(page)) do
  336. if jobId ~= game.JobId and not table.find(CheckJobIdServer(), jobId) then
  337. pcall(function()
  338. ReplicatedStorage.__ServerBrowser:InvokeServer("teleport", jobId)
  339. end)
  340. return
  341. end
  342. end
  343. end
  344. end
  345.  
  346. -- ============================================================================
  347. -- COMBAT (minimal - only what's needed for defense while chest farming)
  348. -- ============================================================================
  349. local Mouse = require(ReplicatedStorage.Mouse)
  350. local CombatUtil = require(ReplicatedStorage.Modules.CombatUtil)
  351. local NetMod = require(ReplicatedStorage.Modules.Net)
  352. local RegisterAttack = NetMod:WaitForChild("RE/RegisterAttack")
  353. local RegisterHit = NetMod:RemoteEvent("RegisterHit", true)
  354.  
  355. v_u_27 = 0
  356. v_u_28 = false
  357. v_u_33 = false
  358. v_u_31 = nil
  359. v_u_32 = 0
  360. v_u_21 = 0
  361. v_u_16 = 1
  362.  
  363. local function AllTargets(includePlayers)
  364. local list = {}
  365. for _, v in pairs(workspace:WaitForChild("Enemies"):GetChildren()) do table.insert(list, v) end
  366. if includePlayers then
  367. for _, v in pairs(workspace:WaitForChild("Characters"):GetChildren()) do table.insert(list, v) end
  368. end
  369. return list
  370. end
  371.  
  372. getgenv().getBladeHits = function(selfChar, origins, baseRadius, includePlayers)
  373. local hits = {}
  374. for _, mob in pairs(AllTargets(includePlayers)) do
  375. if mob:IsDescendantOf(Workspace) and mob ~= selfChar and mob:FindFirstChild("HumanoidRootPart") then
  376. local hrp = mob.HumanoidRootPart
  377. local radius = Players:GetPlayerFromCharacter(mob) and (baseRadius / 1.5) or baseRadius
  378. local points = { hrp.Position }
  379. if hrp.Size.Y > 5 then
  380. table.insert(points, (hrp.CFrame * CFrame.new(0, -hrp.Size.Y * 1.5 + 3, 0)).Position)
  381. end
  382. for _, pt in pairs(points) do
  383. if (pt - origins[1].Position).Magnitude < 10 + radius + hrp.Size.X / 2 then
  384. for _, part in pairs(mob:GetChildren()) do
  385. if part:IsA("BasePart") and (part.Position - origins[1].Position).Magnitude <= radius + hrp.Size.X / 2 then
  386. table.insert(hits, part)
  387. end
  388. end
  389. break
  390. end
  391. end
  392. end
  393. end
  394. return hits
  395. end
  396.  
  397. local BODY_PARTS = {
  398. RightUpperArm = true, RightLowerArm = true, RightHand = true,
  399. RightUpperLeg = true, RightLowerLeg = true, RightFoot = true,
  400. LeftUpperArm = true, LeftLowerArm = true, LeftHand = true,
  401. LeftUpperLeg = true, LeftLowerLeg = true, LeftFoot = true,
  402. UpperTorso = true, LowerTorso = true, Head = true,
  403. }
  404.  
  405. local function AttackAOE(radius, includePlayers)
  406. local found, seen = {}, {}
  407. local origins = { t.Character.HumanoidRootPart }
  408. for _, part in pairs(getgenv().getBladeHits(t.Character, origins, radius or 80, includePlayers)) do
  409. local rig = CombatUtil:GetRigOfHitPart(part)
  410. if rig and not seen[rig] and BODY_PARTS[part.Name] and CombatUtil:IsVulnerable(rig) then
  411. local summoner, selfSummoner = rig:FindFirstChild("Summoner"), t.Character:FindFirstChild("Summoner")
  412. if rig ~= t.Character
  413. and (not selfSummoner or rig ~= selfSummoner.Value.Character)
  414. and (not Players:GetPlayerFromCharacter(t.Character) or not summoner
  415. or summoner.Value ~= Players:GetPlayerFromCharacter(t.Character)) then
  416. table.insert(found, { rig, part })
  417. seen[rig] = true
  418. end
  419. end
  420. end
  421. return #found > 0 and found or nil
  422. end
  423.  
  424. local function attackMelee(radius)
  425. local tool = t.Character:FindFirstChildOfClass("Tool")
  426. if not tool then return end
  427. local hits = AttackAOE(radius, false)
  428. if not hits then return end
  429. local hum = t.Character.Humanoid
  430. local root = hum and hum.RootPart
  431. root = root and root.Parent
  432. local anims = CombatUtil:GetMovesetAnimCache(hum)
  433. if anims then
  434. local weaponName = CombatUtil:GetWeaponName(tool)
  435. local data = CombatUtil:GetWeaponData(weaponName)
  436. local weaponType, moveset = data.WeaponType, data.Moveset
  437. if CombatUtil:CanAttack(root, weaponType) then
  438. v_u_33 = true; v_u_32 = 5; v_u_21 = os.clock()
  439. v_u_27 += 1
  440. if v_u_27 > #moveset.Basic then v_u_27 = 1 end
  441. local anim = anims[CombatUtil:GetPureWeaponName(weaponName) .. "-basic" .. v_u_27]
  442. RegisterAttack:FireServer(anim.Length / (anim:GetAttribute("SpeedMult") or 1))
  443. RegisterHit:FireServer(table.remove(hits, 1)[2], hits)
  444. anim:Play(0.1, 1, 1 * (anim:GetAttribute("SpeedMult") or 1))
  445. v_u_28 = true
  446. task.delay(anim.Length / (anim:GetAttribute("SpeedMult") or 1) * v_u_16, function()
  447. v_u_28 = false
  448. end)
  449. v_u_31 = anim
  450. table.clear(hits)
  451. end
  452. end
  453. end
  454.  
  455. function AttackFunction(radius)
  456. if t.Character.Stun.Value ~= 0 then return end
  457. if not Settings["Attack No Animation "] then
  458. attackMelee(radius)
  459. else
  460. local hits = AttackAOE(radius, false)
  461. if not hits then return end
  462. RegisterAttack:FireServer(0)
  463. RegisterHit:FireServer(table.remove(hits, 1)[2], hits)
  464. table.clear(hits)
  465. end
  466. end
  467.  
  468. function NameWeapon(tooltip, returnTool)
  469. local function find(container)
  470. for _, item in pairs(container:GetChildren()) do
  471. if item:IsA("Tool") and item.ToolTip == tooltip then
  472. return returnTool and item or item.Name
  473. end
  474. end
  475. end
  476. return find(t.Backpack) or find(t.Character)
  477. end
  478.  
  479. function equiptool(name)
  480. if name and t:FindFirstChild("Backpack") and t.Backpack:FindFirstChild(name) and not t.Character.Humanoid.Sit then
  481. t.Character.Humanoid:EquipTool(t.Backpack:FindFirstChild(name))
  482. end
  483. end
  484.  
  485. function ClickM1(mob, isBoat)
  486. if not (t.Character and t.Character:FindFirstChild("HumanoidRootPart")
  487. and mob and mob:FindFirstChild("HumanoidRootPart")
  488. and mob.Humanoid.Health > 0
  489. and (t.Character.HumanoidRootPart.Position - mob.HumanoidRootPart.Position).Magnitude < 70) then
  490. return
  491. end
  492. if Settings["Select Weapon"] == "Blox Fruit" then
  493. local fruitTool = t.Character:FindFirstChild(NameWeapon("Blox Fruit"))
  494. if fruitTool and fruitTool:FindFirstChild("LeftClickRemote") then
  495. local lookDir = (mob.HumanoidRootPart.Position - t.Character.HumanoidRootPart.Position).Unit
  496. local seq = math.random(1, 5)
  497. fruitTool.LeftClickRemote:FireServer(lookDir, seq)
  498. return
  499. end
  500. end
  501. AttackFunction(isBoat and 80 or 30)
  502. end
  503.  
  504. -- ============================================================================
  505. -- FAST ATTACK (verbatim PASS32 pattern)
  506. -- ============================================================================
  507. local CombatFrameworkR = nil
  508. pcall(function()
  509. local cfMod = require(t.PlayerScripts:WaitForChild("CombatFramework"))
  510. local ups = debug.getupvalues(cfMod)
  511. CombatFrameworkR = ups and ups[2]
  512. end)
  513. pcall(function()
  514. local shaker = require(ReplicatedStorage.Util.CameraShaker)
  515. if shaker and shaker.Stop then shaker:Stop() end
  516. end)
  517.  
  518. local function FastAttackOnce()
  519. if not (getgenv().Usefastattack or getgenv().SuperFastAttack) then return end
  520. if not CombatFrameworkR then return end
  521. local controller = CombatFrameworkR.activeController
  522. if not controller then return end
  523. pcall(function()
  524. controller.hitboxMagnitude = getgenv().SuperFastAttack and 60 or 55
  525. controller.timeToNextAttack = 0
  526. controller.attacking = false
  527. controller.increment = 3
  528. controller.blocking = false
  529. controller.timeToNextBlock = 0
  530. if controller.attack then controller:attack() end
  531. local hum = t.Character and t.Character:FindFirstChildOfClass("Humanoid")
  532. if hum then hum.Sit = false end
  533. end)
  534. end
  535.  
  536. task.spawn(function()
  537. while task.wait() do
  538. if getgenv().Usefastattack or getgenv().SuperFastAttack then
  539. FastAttackOnce()
  540. end
  541. end
  542. end)
  543.  
  544. -- ============================================================================
  545. -- AUTO CHEST (verbatim from source with StackFarmOther defaulted true)
  546. -- ============================================================================
  547. getgenv().StackFarmOther = true
  548. local chestCount = 0
  549.  
  550. function AutoChest()
  551. if not getgenv().StackFarmOther then return end
  552. local limit = Settings["Value Collect Chest to Hop"] or 20
  553.  
  554. if Settings["Attack Darkbeard"] and CheckNameBoss("Darkbeard") then
  555. chestCount = limit; return
  556. end
  557. if Settings["Summon Darkbeard"] and DetectItemPlr("Fist of Darkness") then
  558. chestCount = limit; return
  559. end
  560. if (DetectItemPlr("Fist of Darkness") or DetectItemPlr("God's Chalice"))
  561. and Settings["Tween Safe if have Items"] then return end
  562.  
  563. if chestCount >= limit and Settings["Auto Chest Hop"] then
  564. HopServer()
  565. return
  566. end
  567.  
  568. local chest = GetNearestChest()
  569. if chest then
  570. chestCount += 1
  571. local stuckT
  572. repeat
  573. task.wait()
  574. if (t.Character.HumanoidRootPart.Position - chest.Position).Magnitude <= 5 then
  575. if not stuckT then stuckT = tick()
  576. elseif tick() - stuckT >= 5 then
  577. Instance.new("IntValue", chest).Name = "Ignored"
  578. task.wait(0.1)
  579. end
  580. if not Settings["Use Method Teleport"] then
  581. VirtualInputManager:SendKeyEvent(true, "Space", false, game)
  582. task.wait()
  583. VirtualInputManager:SendKeyEvent(false, "Space", false, game)
  584. end
  585. TweenManager.CancelCurrent()
  586. end
  587. if Settings["Use Method Teleport"] then
  588. t.Character.HumanoidRootPart.CFrame = chest.CFrame
  589. TweenManager.CancelCurrent()
  590. else
  591. toTarget(chest.CFrame, true)
  592. end
  593. until not chest
  594. or not chest.Parent
  595. or not Settings["Auto Chest"]
  596. or chest:GetAttribute("IsDisabled")
  597. or chest:FindFirstChild("Ignored")
  598. or not chest:FindFirstChild("TouchInterest")
  599. or not getgenv().StackFarmOther
  600. else
  601. local pathChest = PathFindChest()
  602. if pathChest then
  603. toTarget(pathChest.Part.CFrame)
  604. if (pathChest.Part.Position - t.Character.HumanoidRootPart.Position).Magnitude <= 100
  605. or GetNearestChest() then
  606. Instance.new("IntValue", pathChest).Name = "Ignored"
  607. end
  608. else
  609. for _, v in pairs(workspace._WorldOrigin.PlayerSpawns.Pirates:GetChildren()) do
  610. if v:FindFirstChild("Ignored") then v.Ignored:Destroy() end
  611. end
  612. end
  613. end
  614. end
  615.  
  616. -- Auto Chest toggle loop
  617. task.spawn(function()
  618. while task.wait(0.1) do
  619. pcall(function()
  620. if Settings["Auto Chest"] then
  621. AutoChest()
  622. end
  623. end)
  624. end
  625. end)
  626.  
  627. -- Collect Chest When Server Spawn loop
  628. task.spawn(function()
  629. while task.wait() do
  630. pcall(function()
  631. if not Settings["Collect Chest When Server Spawn God's Chalice or Fist of Darkness"] then return end
  632. if not getgenv().GoCollectChest then return end
  633. if getgenv().ValueCollectChestSpawnGod >= 10 then
  634. getgenv().GoCollectChest = false
  635. getgenv().ValueCollectChestSpawnGod = 0
  636. return
  637. end
  638. local chest = GetNearestChest()
  639. if chest then
  640. getgenv().ValueCollectChestSpawnGod += 1
  641. local stuckT
  642. repeat
  643. task.wait()
  644. if (t.Character.HumanoidRootPart.Position - chest.Position).Magnitude <= 5 then
  645. if not stuckT then stuckT = tick()
  646. elseif tick() - stuckT >= 5 then
  647. Instance.new("IntValue", chest).Name = "Ignored"
  648. task.wait(0.1)
  649. end
  650. if not Settings["Use Method Teleport"] then
  651. VirtualInputManager:SendKeyEvent(true, "Space", false, game)
  652. task.wait()
  653. VirtualInputManager:SendKeyEvent(false, "Space", false, game)
  654. end
  655. TweenManager.CancelCurrent()
  656. end
  657. if Settings["Use Method Teleport"] then
  658. t.Character.HumanoidRootPart.CFrame = chest.CFrame
  659. TweenManager.CancelCurrent()
  660. else
  661. toTarget(chest.CFrame, true)
  662. end
  663. until not chest
  664. or not chest.Parent
  665. or not Settings["Collect Chest When Server Spawn God's Chalice or Fist of Darkness"]
  666. or chest:GetAttribute("IsDisabled")
  667. or chest:FindFirstChild("Ignored")
  668. or not chest:FindFirstChild("TouchInterest")
  669. return
  670. else
  671. local pathChest = PathFindChest()
  672. if pathChest then
  673. toTarget(pathChest.Part.CFrame)
  674. if (pathChest.Part.Position - t.Character.HumanoidRootPart.Position).Magnitude <= 100
  675. or GetNearestChest() then
  676. Instance.new("IntValue", pathChest).Name = "Ignored"
  677. end
  678. else
  679. for _, v in pairs(workspace._WorldOrigin.PlayerSpawns.Pirates:GetChildren()) do
  680. if v:FindFirstChild("Ignored") then v.Ignored:Destroy() end
  681. end
  682. end
  683. end
  684. end)
  685. end
  686. end)
  687.  
  688. -- ============================================================================
  689. -- NOCLIP
  690. -- ============================================================================
  691. task.spawn(function()
  692. while task.wait() do
  693. if Settings["Noclip"] then
  694. pcall(function()
  695. local char = t.Character
  696. if char then
  697. for _, part in pairs(char:GetDescendants()) do
  698. if (part:IsA("MeshPart") or part:IsA("Part")) and part.CanCollide then
  699. part.CanCollide = false
  700. end
  701. end
  702. end
  703. end)
  704. end
  705. end
  706. end)
  707.  
  708. -- ============================================================================
  709. -- AUTO REJOIN
  710. -- ============================================================================
  711. task.spawn(function()
  712. while task.wait(2) do
  713. pcall(function()
  714. if Settings["Auto rejoin Disconnect"] then
  715. local errorPrompt = game:GetService("CoreGui"):FindFirstChild("RobloxPromptGui")
  716. if errorPrompt and errorPrompt:FindFirstChild("promptOverlay") then
  717. local msg = errorPrompt.promptOverlay:FindFirstChild("ErrorPrompt")
  718. if msg and msg:FindFirstChild("MessageArea") and msg.MessageArea:FindFirstChild("ErrorFrame") then
  719. local text = msg.MessageArea.ErrorFrame:FindFirstChild("ErrorMessage")
  720. if text and not string.find(text.Text, "Teleport") then
  721. game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId, game.JobId, t)
  722. end
  723. end
  724. end
  725. end
  726. end)
  727. end
  728. end)
  729.  
  730. -- ============================================================================
  731. -- AIMHOOK (only when chest loop active + combat needed)
  732. -- ============================================================================
  733. do
  734. local mt = getrawmetatable(game)
  735. local oldNamecall = mt.__namecall
  736. setreadonly(mt, false)
  737. mt.__namecall = newcclosure(function(self, ...)
  738. local method = getnamecallmethod()
  739. local args = { ... }
  740. local aimPos = getgenv().AimPos
  741. if method == "FireServer" and self.Name == "RemoteEvent" and aimPos
  742. and tostring(aimPos.X) ~= "nan"
  743. and (Settings["Auto Chest"] or getgenv().Usefastattack) then
  744. if #args == 1 and typeof(args[1]) == "Vector3" then
  745. args[1] = aimPos.Position
  746. elseif #args == 1 and typeof(args[1]) == "CFrame" then
  747. args[1] = aimPos
  748. end
  749. end
  750. return oldNamecall(self, unpack(args))
  751. end)
  752. setreadonly(mt, true)
  753. end
  754.  
  755. -- ============================================================================
  756. -- RAYFIELD UI
  757. -- ============================================================================
  758. local Window = Rayfield:CreateWindow({
  759. Name = "Gleavin Hub // Chest Farm",
  760. LoadingTitle = "Gleavin Hub",
  761. LoadingSubtitle = "Chest Farm",
  762. Theme = "Default",
  763. ConfigurationSaving = {
  764. Enabled = true,
  765. FolderName = "GleavinHub",
  766. FileName = "ChestFarmConfig"
  767. },
  768. KeySystem = false,
  769. })
  770.  
  771. -- =========== TAB 1: CHEST ===========
  772. local ChestTab = Window:CreateTab("Chest", 4483362458)
  773.  
  774. ChestTab:CreateSection("Main Loop")
  775.  
  776. ChestTab:CreateToggle({
  777. Name = "Auto Chest",
  778. CurrentValue = Settings["Auto Chest"] or false,
  779. Flag = "AutoChestFlag",
  780. Callback = function(v)
  781. Settings["Auto Chest"] = v
  782. SaveSettings("Auto Chest", v)
  783. end,
  784. })
  785.  
  786. ChestTab:CreateToggle({
  787. Name = "Auto Chest Hop",
  788. CurrentValue = Settings["Auto Chest Hop"] or false,
  789. Flag = "AutoChestHopFlag",
  790. Callback = function(v)
  791. Settings["Auto Chest Hop"] = v
  792. SaveSettings("Auto Chest Hop", v)
  793. end,
  794. })
  795.  
  796. ChestTab:CreateSlider({
  797. Name = "Value Collect Chest to Hop",
  798. Range = { 0, 100 },
  799. Increment = 1,
  800. Suffix = "chests",
  801. CurrentValue = Settings["Value Collect Chest to Hop"] or 20,
  802. Flag = "ValueHopFlag",
  803. Callback = function(v)
  804. Settings["Value Collect Chest to Hop"] = v
  805. SaveSettings("Value Collect Chest to Hop", v)
  806. end,
  807. })
  808.  
  809. ChestTab:CreateToggle({
  810. Name = "Use Method Teleport",
  811. CurrentValue = Settings["Use Method Teleport"] or false,
  812. Flag = "UseTpFlag",
  813. Callback = function(v)
  814. Settings["Use Method Teleport"] = v
  815. SaveSettings("Use Method Teleport", v)
  816. end,
  817. })
  818.  
  819. ChestTab:CreateSection("Special Spawn (4h Fist of Darkness / God's Chalice)")
  820.  
  821. ChestTab:CreateToggle({
  822. Name = "Collect Chest When Server Spawn God's Chalice / Fist of Darkness",
  823. CurrentValue = Settings["Collect Chest When Server Spawn God's Chalice or Fist of Darkness"] or false,
  824. Flag = "CollectSpecialFlag",
  825. Callback = function(v)
  826. Settings["Collect Chest When Server Spawn God's Chalice or Fist of Darkness"] = v
  827. SaveSettings("Collect Chest When Server Spawn God's Chalice or Fist of Darkness", v)
  828. end,
  829. })
  830.  
  831. ChestTab:CreateSection("Item Safety")
  832.  
  833. ChestTab:CreateToggle({
  834. Name = "Tween Safe if have Items",
  835. CurrentValue = Settings["Tween Safe if have Items"] or false,
  836. Flag = "SafeItemsFlag",
  837. Callback = function(v)
  838. Settings["Tween Safe if have Items"] = v
  839. SaveSettings("Tween Safe if have Items", v)
  840. end,
  841. })
  842.  
  843. -- =========== TAB 2: STATUS ===========
  844. local StatusTab = Window:CreateTab("Status", 4483362458)
  845.  
  846. StatusTab:CreateSection("Server Timer")
  847.  
  848. local timerParagraph = StatusTab:CreateParagraph({
  849. Title = "Next Fist of Darkness / God's Chalice Spawn",
  850. Content = "calculating..."
  851. })
  852.  
  853. StatusTab:CreateSection("Collect Status")
  854.  
  855. local collectParagraph = StatusTab:CreateParagraph({
  856. Title = "Collect Status",
  857. Content = "Idle"
  858. })
  859.  
  860. task.spawn(function()
  861. while task.wait(1) do
  862. pcall(function()
  863. local remaining = getgenv().NextSpawnSeconds
  864. if remaining then
  865. local hh = math.floor(remaining / 3600)
  866. local mm = math.floor(remaining % 3600 / 60)
  867. local ss = math.floor(remaining % 60)
  868. timerParagraph:Set({
  869. Title = "Next Fist of Darkness / God's Chalice Spawn",
  870. Content = string.format("%02d:%02d:%02d", hh, mm, ss)
  871. })
  872. else
  873. timerParagraph:Set({
  874. Title = "Next Fist of Darkness / God's Chalice Spawn",
  875. Content = "no data — join a server with world origin loaded"
  876. })
  877. end
  878.  
  879. if getgenv().GoCollectChest then
  880. collectParagraph:Set({
  881. Title = "Collect Status",
  882. Content = "RUSHING to spawn chest — " .. getgenv().ValueCollectChestSpawnGod .. "/10"
  883. })
  884. elseif Settings["Collect Chest When Server Spawn God's Chalice or Fist of Darkness"] then
  885. collectParagraph:Set({
  886. Title = "Collect Status",
  887. Content = "Armed — waiting for 4h spawn"
  888. })
  889. else
  890. collectParagraph:Set({
  891. Title = "Collect Status",
  892. Content = "Idle"
  893. })
  894. end
  895. end)
  896. end
  897. end)
  898.  
  899. -- =========== TAB 3: COMBAT ===========
  900. local CombatTab = Window:CreateTab("Combat", 4483362458)
  901.  
  902. CombatTab:CreateSection("Defense")
  903.  
  904. CombatTab:CreateDropdown({
  905. Name = "Select Weapon",
  906. Options = { "Melee", "Sword", "Blox Fruit" },
  907. CurrentOption = Settings["Select Weapon"] or "Melee",
  908. MultipleOptions = false,
  909. Flag = "WeaponFlag",
  910. Callback = function(v)
  911. local m = type(v) == "table" and v[1] or v
  912. Settings["Select Weapon"] = m
  913. SaveSettings("Select Weapon", m)
  914. end,
  915. })
  916.  
  917. CombatTab:CreateToggle({
  918. Name = "Attack No Animation",
  919. CurrentValue = Settings["Attack No Animation "] == true,
  920. Flag = "NoAnimFlag",
  921. Callback = function(v)
  922. Settings["Attack No Animation "] = v
  923. SaveSettings("Attack No Animation ", v)
  924. end,
  925. })
  926.  
  927. CombatTab:CreateToggle({
  928. Name = "Fast Attack",
  929. CurrentValue = Settings["Fast Attack"] or false,
  930. Flag = "FastAttackFlag",
  931. Callback = function(v)
  932. getgenv().Usefastattack = v
  933. getgenv().fastattect = v
  934. SaveSettings("Fast Attack", v)
  935. end,
  936. })
  937.  
  938. CombatTab:CreateToggle({
  939. Name = "Super Fast Attack",
  940. CurrentValue = Settings["Super Fast Attack"] or false,
  941. Flag = "SuperFastFlag",
  942. Callback = function(v)
  943. getgenv().SuperFastAttack = v
  944. if v then
  945. getgenv().Usefastattack = true
  946. getgenv().fastattect = true
  947. end
  948. SaveSettings("Super Fast Attack", v)
  949. end,
  950. })
  951.  
  952. -- =========== TAB 4: MOVEMENT ===========
  953. local MoveTab = Window:CreateTab("Movement", 4483362458)
  954.  
  955. MoveTab:CreateSection("Tween")
  956.  
  957. MoveTab:CreateSlider({
  958. Name = "Speed Tween",
  959. Range = { 0, 1000 },
  960. Increment = 10,
  961. Suffix = "studs/s",
  962. CurrentValue = Settings["Speed Tween "] or 300,
  963. Flag = "SpeedTweenFlag",
  964. Callback = function(v)
  965. Settings["Speed Tween "] = v
  966. SaveSettings("Speed Tween ", v)
  967. end,
  968. })
  969.  
  970. MoveTab:CreateToggle({
  971. Name = "Noclip",
  972. CurrentValue = Settings["Noclip"] or false,
  973. Flag = "NoclipFlag",
  974. Callback = function(v)
  975. Settings["Noclip"] = v
  976. SaveSettings("Noclip", v)
  977. end,
  978. })
  979.  
  980. MoveTab:CreateSection("Health Safety")
  981.  
  982. MoveTab:CreateToggle({
  983. Name = "Teleport Y if low health",
  984. CurrentValue = Settings["Teleport Y"] or false,
  985. Flag = "TeleportYFlag",
  986. Callback = function(v)
  987. Settings["Teleport Y"] = v
  988. SaveSettings("Teleport Y", v)
  989. end,
  990. })
  991.  
  992. MoveTab:CreateSlider({
  993. Name = "Health % Threshold",
  994. Range = { 0, 100 },
  995. Increment = 1,
  996. Suffix = "%",
  997. CurrentValue = Settings["% Health Player"] or 40,
  998. Flag = "HPThresholdFlag",
  999. Callback = function(v)
  1000. Settings["% Health Player"] = v
  1001. SaveSettings("% Health Player", v)
  1002. end,
  1003. })
  1004.  
  1005. MoveTab:CreateSlider({
  1006. Name = "Y Teleport Distance",
  1007. Range = { 0, 10000 },
  1008. Increment = 50,
  1009. Suffix = "studs",
  1010. CurrentValue = Settings["Distance Teleport Y"] or 800,
  1011. Flag = "DistanceYFlag",
  1012. Callback = function(v)
  1013. Settings["Distance Teleport Y"] = v
  1014. SaveSettings("Distance Teleport Y", v)
  1015. end,
  1016. })
  1017.  
  1018. -- =========== TAB 5: SERVER ===========
  1019. local ServerTab = Window:CreateTab("Server", 4483362458)
  1020.  
  1021. ServerTab:CreateSection("Hop")
  1022.  
  1023. ServerTab:CreateButton({
  1024. Name = "Hop Server",
  1025. Callback = function()
  1026. HopServer()
  1027. end,
  1028. })
  1029.  
  1030. ServerTab:CreateToggle({
  1031. Name = "Auto Rejoin Disconnect",
  1032. CurrentValue = Settings["Auto rejoin Disconnect"] or false,
  1033. Flag = "RejoinFlag",
  1034. Callback = function(v)
  1035. Settings["Auto rejoin Disconnect"] = v
  1036. SaveSettings("Auto rejoin Disconnect", v)
  1037. end,
  1038. })
  1039.  
  1040. ServerTab:CreateSection("Info")
  1041.  
  1042. ServerTab:CreateParagraph({
  1043. Title = "PlaceId",
  1044. Content = "current: " .. tostring(game.PlaceId)
  1045. })
  1046.  
  1047. -- =========== TAB 6: INFO ===========
  1048. local InfoTab = Window:CreateTab("Info", 4483362458)
  1049.  
  1050. InfoTab:CreateSection("Gleavin Hub // Chest Farm")
  1051.  
  1052. InfoTab:CreateParagraph({
  1053. Title = "How to use",
  1054. Content = "1. Toggle Auto Chest (Chest tab)\n" ..
  1055. "2. Optional: enable Auto Chest Hop + set Value Collect to Hop\n" ..
  1056. "3. For the 4-hour Fist of Darkness / God's Chalice spawn:\n" ..
  1057. " - Toggle Collect Chest When Server Spawn\n" ..
  1058. " - Watch the Status tab for the countdown\n" ..
  1059. " - When timer hits 00:00:00, bot auto-rushes the chest\n" ..
  1060. "4. If you hold FoD or God's Chalice:\n" ..
  1061. " - Enable Tween Safe if have Items\n" ..
  1062. " - Bot teleports to safe zone until you do something with it\n\n" ..
  1063. "Do not run two Gleavin Hub scripts at once.",
  1064. })
  1065.  
  1066. InfoTab:CreateSection("Chest Farm Mechanics")
  1067.  
  1068. InfoTab:CreateParagraph({
  1069. Title = "Behavior",
  1070. Content = "• Auto Chest walks to nearest unignored chest\n" ..
  1071. "• If no chest tagged, walks to pirate spawns\n" ..
  1072. "• Marks chest as Ignored after 5s stuck (prevents loop)\n" ..
  1073. "• Hop Server skips jobs you've visited\n" ..
  1074. "• Collect Chest priority overrides Auto Chest when 4h timer hits",
  1075. })
  1076.  
  1077. InfoTab:CreateButton({
  1078. Name = "Unload Gleavin Hub",
  1079. Callback = function()
  1080. getgenv().__GLEAVIN_CHEST_LOADED = false
  1081. if Rayfield and Rayfield.Destroy then Rayfield:Destroy() end
  1082. end,
  1083. })
  1084.  
  1085. -- ============================================================================
  1086. -- INITIALIZE
  1087. -- ============================================================================
  1088. Rayfield:LoadConfiguration()
  1089. Notify("Gleavin Hub", "Chest Farm loaded")
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment