eea

fillball6

eea
Sep 11th, 2021 (edited)
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. local remote = Instance.new("RemoteEvent",game.ReplicatedStorage)
  2. remote.Name = owner.Name
  3.  
  4. NLS([[
  5. local Key = game:GetService("UserInputService")
  6. local players = game:GetService("Players")
  7. local player = players.LocalPlayer
  8. local mouse = player:GetMouse()
  9. local character = player.Character
  10. local root = character:WaitForChild("HumanoidRootPart")
  11. local remote = game.ReplicatedStorage:FindFirstChild(owner.Name)
  12. local terrain = workspace.Terrain
  13. local mat = Enum.Material.Grass
  14. local size = 10
  15. local destroysize = 11
  16.  
  17. local mats = {
  18.  
  19. {CallBy = "grass", Material = Enum.Material.Grass};
  20. {CallBy = "water", Material = Enum.Material.Water};
  21. {CallBy = "sand", Material = Enum.Material.Sand};
  22. {CallBy = "slate", Material = Enum.Material.Slate};
  23. {CallBy = "concrete", Material = Enum.Material.Concrete};
  24. {CallBy = "ice", Material = Enum.Material.Ice};
  25. {CallBy = "brick", Material = Enum.Material.Brick};
  26. {CallBy = "woodplank", Material = Enum.Material.WoodPlanks};
  27. {CallBy = "cobblestone", Material = Enum.Material.Cobblestone};
  28. {CallBy = "rock", Material = Enum.Material.Rock};
  29.  
  30. }
  31.  
  32. Key.InputBegan:Connect(function(key)
  33. if key.KeyCode == Enum.KeyCode.LeftControl then
  34. for i, v in pairs(mats) do
  35. print(v["CallBy"])
  36. end
  37. end
  38. end)
  39.  
  40. player.Chatted:Connect(function(message)
  41. for i,v in pairs(mats) do
  42. if message == "mat "..v["CallBy"] then
  43. mat = v["Material"]
  44. end
  45. end
  46.  
  47. if string.sub(message,1,4) == "size" then
  48. size = string.sub(message,5)
  49. end
  50.  
  51. if string.sub(message,1,6) == "ersize" then
  52. destroysize = string.sub(message,7)
  53. end
  54. end)
  55.  
  56. mouse.Button1Down:Connect(function()
  57. if remote then
  58. remote:FireServer(mouse.Hit.Position,1,mat,size)
  59. end
  60. end)
  61.  
  62. mouse.Button2Down:Connect(function()
  63. if remote then
  64. remote:FireServer(mouse.Hit.Position,0,0,0,destroysize)
  65. end
  66. end)
  67. ]], owner.Character)
  68.  
  69. game.ReplicatedStorage:FindFirstChild(owner.Name).OnServerEvent:Connect(function(player, mousepos,d, material,size,destrsize)
  70. if d == 1 then
  71. --vector3 center, number radius and enum material
  72. workspace.Terrain:FillBall(mousepos, size, material)
  73. end
  74.  
  75. if d == 0 then
  76. --vector3 center, number radius and enum material
  77. workspace.Terrain:FillBall(mousepos,destrsize,Enum.Material.Air)
  78. end
  79. end)
Add Comment
Please, Sign In to add comment