Advertisement
havefuntz

another booga reborn script

Oct 10th, 2022
1,090
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.42 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  3. local TweenService = game:GetService("TweenService")
  4. local ui = loadstring(game:HttpGet("https://raw.githubusercontent.com/Singularity5490/rbimgui-2/main/rbimgui-2.lua"))()
  5. local window = ui.new({text=I Wish I Knew"})
  6. local mainTab = window.new({text="main"})
  7. local combatTab = window.new({text="combat"})
  8. local autofarmTab = window.new({text="autofarm"})
  9. local killauraToggle = combatTab.new("Switch", {text="kill aura"})
  10. local autohealToggle = combatTab.new("Switch", {text="auto heal"})
  11. local autohealSlider = combatTab.new("Slider", {text="auto heal all food", min=1, max=100, value=90})
  12. local breakauraToggle = mainTab.new("Switch", {text="Break Aura"})
  13. local pickupToggle = mainTab.new("Switch", {text="PickUp aura"})
  14. local autofarmToggle = autofarmTab.new("Switch", {text="autofarm Nearby [frozen possible]"})
  15. local autoPlant = autofarmTab.new("Switch", {text="auto plant"})
  16. local autoharvest = autofarmTab.new("Switch", {text="auto harvest"})
  17. local chosenFruit = "Bloodfruit"
  18. local fruits = {
  19. "Bloodfruit",
  20. "Sunfruit",
  21. "Bluefruit",
  22. "Berry"
  23. }
  24.  
  25. local autoplantDropdown = autofarmTab.new("Dropdown", {text="fruits"})
  26. local plantButton = autofarmTab.new("Button", {text="plant 1-5 plantboxes"})
  27. plantButton.event:Connect(function()
  28. for i = 1, 5 do
  29. local ohString1 = "Plant Box"
  30. local ohCFrame2 = CFrame.new(Players.LocalPlayer.Character.HumanoidRootPart.Position.X,Players.LocalPlayer.Character.HumanoidRootPart.Position.Y-3,Players.LocalPlayer.Character.HumanoidRootPart.Position.Z+i, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  31. local ohNumber3 = 0
  32. game:GetService("ReplicatedStorage").Events.PlaceStructure:FireServer(ohString1, ohCFrame2, ohNumber3)
  33. end
  34. end)
  35. for i,v in pairs(fruits) do
  36. autoplantDropdown.new(v)
  37. end
  38. local mouse = Players.LocalPlayer:GetMouse()
  39.  
  40. autoplantDropdown.event:Connect(function(v)
  41. chosenFruit = v
  42. end)
  43.  
  44.  
  45. local function getClosest()
  46. local hrp = Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart").Position
  47. local closest_distance = math.huge
  48. local closestperson
  49.  
  50. for i,v in pairs(game.Players:GetPlayers()) do
  51. if v.Character ~= nil and v ~= Players.LocalPlayer and v.Character:FindFirstChild("HumanoidRootPart") ~= nil and v.Character:FindFirstChild("Humanoid").Health > 0 then
  52. local plr_pos = v.Character.HumanoidRootPart.Position
  53. local plr_distance = (hrp - plr_pos).Magnitude
  54.  
  55. if plr_distance < closest_distance then
  56. closest_distance = plr_distance
  57. closestperson = v
  58. end
  59. end
  60. end
  61.  
  62. return closestperson
  63. end
  64.  
  65. local function getClosestObject(folder)
  66. local distance, part = math.huge, nil
  67. local mainPart
  68. local Character = Players.LocalPlayer.Character
  69. for i,v in pairs(folder:GetChildren()) do
  70. if Character:FindFirstChild("HumanoidRootPart") then
  71. local HRPPosition = Character:FindFirstChild("HumanoidRootPart").Position
  72.  
  73. for i2,v2 in pairs(v:GetChildren()) do
  74. if v2:IsA("BasePart") then
  75. mainPart = v2
  76. break
  77. end
  78. end
  79.  
  80. if mainPart and not mainPart.Parent:FindFirstChild("Humanoid") and mainPart.Parent:FindFirstChild("Health") then
  81. local realDistance = math.abs((HRPPosition - mainPart.Position).Magnitude)
  82.  
  83. if realDistance < distance then
  84. distance = realDistance
  85. part = mainPart
  86. end
  87. end
  88. end
  89. end
  90. return part
  91. end
  92.  
  93. local function getClosestPickups(folder)
  94. local Character = Players.LocalPlayer.Character
  95. local pickups = {}
  96. for i,v in pairs(folder:GetChildren()) do
  97. if v:FindFirstChild("Pickup") and v:IsA("BasePart") and table.find(pickups,v) == nil and Character:FindFirstChild("HumanoidRootPart") then
  98. if (Character.HumanoidRootPart.Position - v.Position).Magnitude <= 30 then
  99. table.insert(pickups, v)
  100. end
  101. end
  102. end
  103. return pickups
  104. end
  105.  
  106. while wait(0.1) do
  107. local Character = Players.LocalPlayer.Character
  108. if killauraToggle.on and Character:FindFirstChild("HumanoidRootPart") then
  109. local closest = getClosest()
  110. local hrp = Character.HumanoidRootPart.Position
  111.  
  112. -- guessing the distance tbh
  113. if (hrp - closest.Character.HumanoidRootPart.Position).Magnitude <= 14 then
  114. ReplicatedStorage.Events.SwingTool:FireServer(ReplicatedStorage.RelativeTime.Value, {
  115. [1] = closest.Character.HumanoidRootPart
  116. })
  117. end
  118. end
  119.  
  120. if autohealToggle.on then
  121. if Character:FindFirstChild("Humanoid") and Character.Humanoid.Health <= autohealSlider.value then
  122. game:GetService("ReplicatedStorage").Events.UseBagltem:FireServer("Bloodfruit")
  123. end
  124. end
  125.  
  126. if breakauraToggle.on then
  127. if Character:FindFirstChild("HumanoidRootPart") then
  128. local closestPart = getClosestObject(workspace)
  129. local hrp = Character:FindFirstChild("HumanoidRootPart").Position
  130.  
  131. if (hrp - closestPart.Position).Magnitude <= 40 then
  132. ReplicatedStorage.Events.SwingTool:FireServer(ReplicatedStorage.RelativeTime.Value, {
  133. [1] = closestPart
  134. })
  135. end
  136. end
  137. end
  138.  
  139. if pickupToggle.on then
  140. for i,v in pairs(getClosestPickups(workspace)) do
  141. game:GetService("ReplicatedStorage").Events.Pickup:FireServer(v)
  142. end
  143. end
  144. if autofarmToggle.on then
  145. local part = getClosestObject(workspace)
  146. local HRPPosition = Players.LocalPlayer.Character.HumanoidRootPart.Position
  147. local realDistance = math.round(math.abs((HRPPosition - part.Position).Magnitude))
  148.  
  149. ReplicatedStorage.Events.SwingTool:FireServer(ReplicatedStorage.RelativeTime.Value, {
  150. [1] = part
  151. })
  152. for i,v in pairs(getClosestPickups(workspace)) do
  153. game:GetService("ReplicatedStorage").Events.Pickup:FireServer(v)
  154. end
  155. wait(0.1)
  156. if part.Position.Y <= 30 then
  157. TweenService:Create(Players.LocalPlayer.Character.HumanoidRootPart, TweenInfo.new(realDistance/10, Enum.EasingStyle.Linear), {CFrame=part.CFrame+Vector3.new(0,part.Size.Y,0)}):Play()
  158. task.wait(realDistance/10)
  159. end
  160. end
  161.  
  162. if autoPlant.on then
  163. local hrp = Character:FindFirstChild("HumanoidRootPart").Position
  164. for i,v in pairs(workspace.Deployables:GetChildren()) do
  165. if v.Name == "Plant Box" then
  166. local part = v:FindFirstChildOfClass("Part")
  167. if (hrp - part.Position).Magnitude <= 10 then
  168. game:GetService("ReplicatedStorage").Events.lnteractStructure:FireServer(v, chosenFruit)
  169. end
  170. end
  171. end
  172. end
  173.  
  174. if autoharvest.on then
  175. local hrp = Character:FindFirstChild("HumanoidRootPart").Position
  176. for i,v in pairs(workspace:GetChildren()) do
  177. if v.Name == chosenFruit.." Bush" and (hrp - v:FindFirstChildOfClass("Part").Position).Magnitude <= 30 then
  178. game:GetService("ReplicatedStorage").Events.Pickup:FireServer(v)
  179. end
  180. end
  181. end
  182. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement