gerisx

Untitled

Apr 11th, 2026 (edited)
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.00 KB | None | 0 0
  1. -- Configuration
  2. _G.Field = "Grape Field"
  3. _G.emptybackpack = 98
  4. _G.emptyeveryminutes = 10
  5. _G.minimumemptyminutes = 2
  6.  
  7. -- Services
  8. local player = game:GetService("Players").LocalPlayer
  9. local workspace = game:GetService("Workspace")
  10. local debris = workspace:WaitForChild("Debris")
  11. local replStorage = game:GetService("ReplicatedStorage")
  12. local TweenService = game:GetService("TweenService")
  13.  
  14. print("--- Script Started: Auto-Reconnect Enabled ---")
  15.  
  16. local lastHiveTrip = tick()
  17. local lastFieldTrip = tick()
  18. local isEmptying = false
  19. local tweenInfo = TweenInfo.new(0.05, Enum.EasingStyle.Linear)
  20.  
  21. -- Function to handle teleporting safely
  22. local function tweenTeleport(rootPart, targetCFrame)
  23. if not rootPart or not targetCFrame then return end
  24. local tween = TweenService:Create(rootPart, tweenInfo, {CFrame = targetCFrame})
  25. tween:Play()
  26. tween.Completed:Wait()
  27. end
  28.  
  29. local function claimHive()
  30. if player.Hive.Value == "" or player.Hive.Value == nil then
  31. for _, h in pairs(workspace.Hives:GetChildren()) do
  32. if h:FindFirstChild("Claimed") and h.Claimed.Value == false then
  33. replStorage:WaitForChild("Remotes"):WaitForChild("ClaimHive"):FireServer(h)
  34. task.wait(0.5)
  35. break
  36. end
  37. end
  38. end
  39. end
  40.  
  41. local function useHammer(character)
  42. local hammer = character:FindFirstChild("Hammer")
  43. if hammer and hammer:FindFirstChild("ToolRemote") then
  44. hammer.ToolRemote:FireServer()
  45. end
  46. end
  47.  
  48. task.spawn(function()
  49. while task.wait(0.1) do
  50. -- REFRESH CHARACTER DATA EVERY LOOP
  51. local character = player.Character
  52. if not character then continue end
  53.  
  54. local rootPart = character:FindFirstChild("HumanoidRootPart")
  55. local humanoid = character:FindFirstChild("Humanoid")
  56.  
  57. -- Don't run logic if we are dead or missing parts
  58. if not rootPart or not humanoid or humanoid.Health <= 0 then continue end
  59.  
  60. claimHive()
  61. useHammer(character)
  62.  
  63. local currentPollen = player.Pollen.Value
  64. local maxCap = player.Cap.Value
  65. local pollenPercent = (currentPollen / maxCap) * 100
  66.  
  67. local timeSinceLastHive = (tick() - lastHiveTrip) / 60
  68. local timeSinceAtHive = (tick() - lastFieldTrip) / 60
  69.  
  70. -- 1. TRIGGER HIVE
  71. if not isEmptying and (pollenPercent >= _G.emptybackpack or timeSinceLastHive >= _G.emptyeveryminutes) then
  72. isEmptying = true
  73. lastFieldTrip = tick()
  74. end
  75.  
  76. -- 2. EXIT HIVE
  77. if isEmptying and (currentPollen <= 0 or timeSinceAtHive >= _G.minimumemptyminutes) then
  78. isEmptying = false
  79. lastHiveTrip = tick()
  80. end
  81.  
  82. -- 3. ACTIONS
  83. if isEmptying then
  84. local myHiveName = player.Hive.Value
  85. local myHive = workspace.Hives:FindFirstChild(tostring(myHiveName))
  86. if myHive then
  87. rootPart.CFrame = myHive.Platform.Top.CFrame + Vector3.new(0, 3, 0)
  88. if not player.MakingHoney.Value then
  89. replStorage:WaitForChild("Remotes"):WaitForChild("MakeHoney"):FireServer(true)
  90. end
  91. end
  92. else
  93. -- FIELD LOGIC
  94. local fieldFolder = workspace.Fields:FindFirstChild(_G.Field)
  95. if fieldFolder then
  96. local fieldPart = fieldFolder:FindFirstChildWhichIsA("BasePart", true)
  97.  
  98. if fieldPart then
  99. local distance = (rootPart.Position - fieldPart.Position).Magnitude
  100.  
  101. if distance > 50 then
  102. rootPart.CFrame = fieldPart.CFrame + Vector3.new(0, 5, 0)
  103. task.wait(0.5)
  104. else
  105. -- TOKEN COLLECTION
  106. local myTokens = {}
  107. for _, v in pairs(debris.Tokens:GetChildren()) do
  108. -- Change this name if your token name changes
  109. if v.Name == "JuanMez012" then table.insert(myTokens, v) end
  110. end
  111.  
  112. if #myTokens > 0 then
  113. local targetToken = myTokens[1]
  114. if targetToken and targetToken.Parent then
  115. tweenTeleport(rootPart, targetToken.CFrame)
  116. task.wait(0.1)
  117. end
  118. else
  119. -- RANDOM MOVEMENT
  120. local children = fieldFolder:GetChildren()
  121. local randomTarget = children[math.random(1, #children)]
  122. if randomTarget:IsA("BasePart") then
  123. humanoid:MoveTo(randomTarget.Position)
  124. end
  125. end
  126. end
  127. end
  128. end
  129. end
  130. end
  131. end)
Advertisement
Add Comment
Please, Sign In to add comment