KamikazeJAM_YT

Booga Booga Bloodfruit Farm (Hold LeftShift AND G)

Jun 10th, 2019
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.61 KB | None | 0 0
  1. if game.GameId == 511839821 then
  2.     local plantBloodFruit = game.ReplicatedStorage.Events['InteractStructure']
  3.     local player = game.Players.LocalPlayer
  4.     local collect = game.ReplicatedStorage.Events['Pickup']
  5.     _G.BloodToggle = true
  6.  
  7.     while _G.BloodToggle == true do
  8.         local pressed = game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.G)
  9.         local shifting = game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.LeftShift)
  10.         if pressed == true and shifting == true then
  11.             for i, deployable in pairs(game.Workspace:WaitForChild("Deployables"):GetChildren()) do
  12.                 if deployable.Name == "Plant Box" then
  13.                     local part = deployable:FindFirstChild("Compost")
  14.                     if part then
  15.                         local character = player.Character or player.CharacterAdded:Wait()
  16.                         local hrp = character:WaitForChild("HumanoidRootPart")
  17.                         local dist = (part.Position - hrp.Position).magnitude
  18.                         if dist <= 15 then
  19.                             if not deployable:FindFirstChild("Bloodfruit") then
  20.                                 --add check to see if player has bloodfruit to plant
  21.                                 plantBloodFruit:FireServer(deployable, "Bloodfruit")
  22.                             end
  23.                         end
  24.                     end
  25.                 end
  26.             end
  27.             for i, obj in pairs(game.Workspace:GetChildren()) do
  28.                 if obj.Name == "Bloodfruit Bush" then
  29.                     local part = obj:FindFirstChild("Stump")
  30.                     if part then
  31.                         local character = player.Character or player.CharacterAdded:Wait()
  32.                         local hrp = character:WaitForChild("HumanoidRootPart")
  33.                         local dist = (part.Position - hrp.Position).magnitude
  34.                         if dist <= 15 then
  35.                             collect:FireServer(obj)
  36.                         end
  37.                     end
  38.                 end
  39.             end
  40.         end
  41.         wait(0.2)
  42.     end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment