Advertisement
Bossbikram56

booga Auto farm

Sep 6th, 2022
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. local placekey = "p"
  2. local plantkey = "k"
  3. local collectkey = "k"
  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. ----------------no touchy below plz
  7.  
  8. local Player = game:GetService("Players").LocalPlayer
  9. local Mouse = Player:GetMouse()
  10.  
  11. _G.plant = function()
  12. for _, v in pairs(workspace.Deployables:GewtChildren()) do
  13. if v.Name == "Plant Box" and (Player.Character.Head.Position - v.PrimaryPart.Position).magnitude < 500 then
  14. game.ReplicatedStorage.Events.InteractStructure:FireServer(v, "Bloodfruit")
  15. end
  16. end
  17. end
  18.  
  19. _G.collect = function()
  20. for _, v in pairs(workspace:GetChildren()) do
  21. if v.Name == "Bloodfruit Bush" and (Player.Character.Head.Position - v.PrimaryPart.Position).magnitude < 50 then
  22. game.ReplicatedStorage.Events.Pickup:FireServer(v)
  23. end
  24. end
  25. end
  26.  
  27. Mouse.KeyUp:connect(function(k)
  28. if k == placekey then
  29. for i = 1, amountofpots do
  30. game.ReplicatedStorage.Events.PlaceStructure:FireServer("Plant Box", Mouse.Hit, 0)
  31. end
  32. elseif k == plantkey then
  33. _G.plant()
  34. elseif k == collectkey then
  35. _G.collect()
  36. end
  37. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement