Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game.GameId == 511839821 then
- local plantBloodFruit = game.ReplicatedStorage.Events['InteractStructure']
- local player = game.Players.LocalPlayer
- local collect = game.ReplicatedStorage.Events['Pickup']
- _G.BloodToggle = true
- while _G.BloodToggle == true do
- local pressed = game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.G)
- local shifting = game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.LeftShift)
- if pressed == true and shifting == true then
- for i, deployable in pairs(game.Workspace:WaitForChild("Deployables"):GetChildren()) do
- if deployable.Name == "Plant Box" then
- local part = deployable:FindFirstChild("Compost")
- if part then
- local character = player.Character or player.CharacterAdded:Wait()
- local hrp = character:WaitForChild("HumanoidRootPart")
- local dist = (part.Position - hrp.Position).magnitude
- if dist <= 15 then
- if not deployable:FindFirstChild("Bloodfruit") then
- --add check to see if player has bloodfruit to plant
- plantBloodFruit:FireServer(deployable, "Bloodfruit")
- end
- end
- end
- end
- end
- for i, obj in pairs(game.Workspace:GetChildren()) do
- if obj.Name == "Bloodfruit Bush" then
- local part = obj:FindFirstChild("Stump")
- if part then
- local character = player.Character or player.CharacterAdded:Wait()
- local hrp = character:WaitForChild("HumanoidRootPart")
- local dist = (part.Position - hrp.Position).magnitude
- if dist <= 15 then
- collect:FireServer(obj)
- end
- end
- end
- end
- end
- wait(0.2)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment