Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local remote = Instance.new("RemoteEvent",game.ReplicatedStorage)
- remote.Name = owner.Name
- NLS([[
- local Key = game:GetService("UserInputService")
- local players = game:GetService("Players")
- local player = players.LocalPlayer
- local mouse = player:GetMouse()
- local character = player.Character
- local root = character:WaitForChild("HumanoidRootPart")
- local remote = game.ReplicatedStorage:FindFirstChild(owner.Name)
- local terrain = workspace.Terrain
- local mat = Enum.Material.Grass
- local size = 10
- local destroysize = 11
- local mats = {
- {CallBy = "grass", Material = Enum.Material.Grass};
- {CallBy = "water", Material = Enum.Material.Water};
- {CallBy = "sand", Material = Enum.Material.Sand};
- {CallBy = "slate", Material = Enum.Material.Slate};
- {CallBy = "concrete", Material = Enum.Material.Concrete};
- {CallBy = "ice", Material = Enum.Material.Ice};
- {CallBy = "brick", Material = Enum.Material.Brick};
- {CallBy = "woodplank", Material = Enum.Material.WoodPlanks};
- {CallBy = "cobblestone", Material = Enum.Material.Cobblestone};
- {CallBy = "rock", Material = Enum.Material.Rock};
- }
- Key.InputBegan:Connect(function(key)
- if key.KeyCode == Enum.KeyCode.LeftControl then
- for i, v in pairs(mats) do
- print(v["CallBy"])
- end
- end
- end)
- player.Chatted:Connect(function(message)
- for i,v in pairs(mats) do
- if message == "mat "..v["CallBy"] then
- mat = v["Material"]
- end
- end
- if string.sub(message,1,4) == "size" then
- size = string.sub(message,5)
- end
- if string.sub(message,1,6) == "ersize" then
- destroysize = string.sub(message,7)
- end
- end)
- mouse.Button1Down:Connect(function()
- if remote then
- remote:FireServer(mouse.Hit.Position,1,mat,size)
- end
- end)
- mouse.Button2Down:Connect(function()
- if remote then
- remote:FireServer(mouse.Hit.Position,0,0,0,destroysize)
- end
- end)
- ]], owner.Character)
- game.ReplicatedStorage:FindFirstChild(owner.Name).OnServerEvent:Connect(function(player, mousepos,d, material,size,destrsize)
- if d == 1 then
- --vector3 center, number radius and enum material
- workspace.Terrain:FillBall(mousepos, size, material)
- end
- if d == 0 then
- --vector3 center, number radius and enum material
- workspace.Terrain:FillBall(mousepos,destrsize,Enum.Material.Air)
- end
- end)
Add Comment
Please, Sign In to add comment