Advertisement
Guest User

AutoFarm Bloodfruit Booga Booga

a guest
Oct 14th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. local placekey = "p"
  2. local plantkey = "l"
  3. local collectkey = "o"
  4. local amountofpots = 40 ----------------oh yeah i forgot to mention this but you actually need to have the leaves and sticks required to make x number of plant pots
  5.  
  6. ----------------Don't touch below, unless if u know what you're doing!
  7. local Player = game:GetService("Players").LocalPlayer
  8. local Mouse = Player:GetMouse()
  9.  
  10. _G.plant = function()
  11. for _, v in pairs(workspace.Deployables:GetChildren()) do
  12. if v.Name == "Plant Box" and (Player.Character.Head.Position - v.PrimaryPart.Position).magnitude < 500 then
  13. game.ReplicatedStorage.Events.InteractStructure:FireServer(v, "Bloodfruit")
  14. end
  15. end
  16. end
  17.  
  18. _G.collect = function()
  19. for _, v in pairs(workspace:GetChildren()) do
  20. if v.Name == "Bloodfruit Bush" and (Player.Character.Head.Position - v.PrimaryPart.Position).magnitude < 50 then
  21. game.ReplicatedStorage.Events.Pickup:FireServer(v)
  22. end
  23. end
  24. end
  25.  
  26. Mouse.KeyUp:connect(function(k)
  27. if k == placekey then
  28. for i = 1, amountofpots do
  29. game.ReplicatedStorage.Events.PlaceStructure:FireServer("Plant Box", Mouse.Hit, 0)
  30. end
  31. elseif k == plantkey then
  32. _G.plant()
  33. elseif k == collectkey then
  34. _G.collect()
  35. end
  36. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement