Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.72 KB | None | 0 0
  1. local LocalPlayer = game:GetService('Players').LocalPlayer
  2. local RemoteEvents = game:GetService('ReplicatedStorage').RemoteEvents
  3. local Shovel = function(Part)
  4. if LocalPlayer.Character:FindFirstChildWhichIsA('Tool') then
  5. RemoteEvents.Shovel:FireServer(Part)
  6. end
  7. end
  8. local GetCloseSnow = function()
  9. local Center = LocalPlayer.Character.HumanoidRootPart.CFrame.p
  10. local Region = Region3.new(Center-Vector3.new(8,8,8), Center+Vector3.new(15,15,15))
  11. local Parts  = workspace:FindPartsInRegion3(Region, LocalPlayer.Character, 500)
  12. local Snow = {}
  13. for i, v in pairs(Parts) do
  14. if v.Name == 'Snow' then
  15. table.insert(Snow, v)
  16. end
  17. end
  18. return Snow
  19. end
  20. while wait() do
  21. for i, v in pairs(GetCloseSnow()) do
  22. Shovel(v)
  23. end
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement