Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local Flowers = workspace.Flowers:GetChildren()
  3. _G.Autofarming = false
  4.  
  5. local ScreenGui = Instance.new("ScreenGui")
  6. local TextButton = Instance.new("TextButton")
  7. ScreenGui.Parent = Player:WaitForChild("PlayerGui")
  8.  
  9. TextButton.Parent = ScreenGui
  10. TextButton.BackgroundColor3 = Color3.new(0.454902, 1, 0.956863)
  11. TextButton.BorderSizePixel = 0
  12. TextButton.Position = UDim2.new(0, 0, 0.460127592, 0)
  13. TextButton.Size = UDim2.new(0.106215581, 0, 0.0797448158, 0)
  14. TextButton.Font = Enum.Font.SourceSansBold
  15. TextButton.Text = "BEGIN AUTOFARMING"
  16. TextButton.TextColor3 = Color3.new(0.184314, 0.184314, 0.184314)
  17. TextButton.TextScaled = true
  18. TextButton.TextSize = 14
  19. TextButton.TextStrokeColor3 = Color3.new(1, 1, 1)
  20. TextButton.TextStrokeTransparency = 0.10000000149012
  21. TextButton.TextWrapped = true
  22.  
  23. TextButton.MouseButton1Click:Connect(function()
  24. if _G.Autofarming == false then
  25. _G.Autofarming = true
  26. TextButton.Text = "STOP AUTOFARMING"
  27. elseif _G.Autofarming == true then
  28. _G.Autofarming = false
  29. TextButton.Text = "BEGIN AUTOFARMING"
  30. end
  31. end)
  32.  
  33. local function findAvaliablePlot()
  34. for _,v in pairs(workspace.Honeycombs:GetChildren()) do
  35. if v.Owner.Value == nil then
  36. game:GetService("ReplicatedStorage").Events.ClaimHive:FireServer(v.HiveID.Value)
  37. end
  38. end
  39. end
  40.  
  41. local function wep()
  42. if not Player.Character:FindFirstChildOfClass("Tool") then
  43. weapon = Player.Backpack:FindFirstChildOfClass("Tool")
  44. Player.Character.Humanoid:EquipTool(weapon)
  45. return weapon
  46. else
  47. weapon = Player.Character:FindFirstChildOfClass("Tool")
  48. return weapon
  49. end
  50. end
  51.  
  52. while wait() do
  53. if _G.Autofarming then
  54. wep()
  55. if Player:FindFirstChild("Honeycomb") == nil then
  56. findAvaliablePlot()
  57. end
  58. wait()
  59.  
  60. local gui = string.split(Player.PlayerGui.ScreenGui.MeterHUD.PollenMeter.Bar.TextLabel.Text, "/")
  61. local PollenCount = tonumber(gui[1])
  62. local MaxPollen = tonumber(gui[2])
  63.  
  64. if PollenCount < MaxPollen then
  65. if _G.Autofarming then
  66. Player.Character:SetPrimaryPartCFrame(Flowers[math.random(1,#Flowers)].CFrame)
  67. local i = 20
  68. repeat
  69. if not _G.Autofarming then break end
  70. i = i - 1
  71. Player.Character:FindFirstChildOfClass("Tool").ClickEvent:FireServer()
  72. wait()
  73. until i == 0
  74. end
  75. elseif PollenCount == MaxPollen then
  76. if _G.Autofarming then
  77. Player.Character:SetPrimaryPartCFrame(workspace.Honeycombs[tostring(Player.Honeycomb.Value.Name)].SpawnPos.Value)
  78. wait(0.5)
  79. game:GetService("ReplicatedStorage").Events.PlayerHiveCommand:FireServer("ToggleHoneyMaking")
  80. repeat
  81. if not _G.Autofarming then break end
  82. local gui2 = string.split(Player.PlayerGui.ScreenGui.MeterHUD.PollenMeter.Bar.TextLabel.Text, "/")
  83. local PollenCount2 = tonumber(gui2[1])
  84. local MaxPollen2 = tonumber(gui2[2])
  85. wait() until PollenCount2 == 0
  86. end
  87. end
  88. end
  89. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement