Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- tool useless too lazy to remove
- local debris = game:GetService("Debris")
- Tool = Instance.new("Tool")
- Part1 = Instance.new("Part")
- Part1.Name = "Handle"
- Part1.Parent = Tool
- Tool.Parent = owner.Character
- Tool.Name = "builder"
- local built = {} -- storing built parts
- buildremote = Instance.new("RemoteEvent",owner.Character)
- buildremote.Name = "The"
- buildremote.OnServerEvent:Connect(function(plr,action,pos)
- if action == "Build" then -- placing part
- Brick = Instance.new("Part", workspace)
- Brick.Size = Vector3.new(2.5,2.5,2.5)
- Brick.Position = pos
- Brick.Anchored = true
- Brick.Material = Enum.Material.SmoothPlastic
- decal = Instance.new("Texture", Brick)
- decal.StudsPerTileU = 1.25
- decal.StudsPerTileV = 1.25
- decal.Texture = "http://www.roblox.com/asset/?id=8346980490"
- decal.Face = Enum.NormalId.Front
- local clone = decal:Clone()
- clone.Parent = Brick
- clone.Face = Enum.NormalId.Back
- local clone = decal:Clone()
- clone.Parent = Brick
- clone.Face = Enum.NormalId.Top
- local clone = decal:Clone()
- clone.Parent = Brick
- clone.Face = Enum.NormalId.Bottom
- local clone = decal:Clone()
- clone.Parent = Brick
- clone.Face = Enum.NormalId.Left
- local clone = decal:Clone()
- clone.Parent = Brick
- clone.Face = Enum.NormalId.Right
- Brick.Color = Color3.fromRGB(30, 30, 30)
- table.insert(built,Brick) -- storing to delete them later if want
- elseif action == "Destroy" then -- breaking part
- if table.find(built,pos) then -- checking if part to break is a part you built
- oldcf = pos.CFrame
- oldpartcolor = pos.Color
- pos:Destroy()
- local mined = Instance.new("Sound", owner.Character.Head)
- mined.SoundId = "rbxassetid://6496157434"
- mined.Volume = 1
- mined:Play()
- debris:AddItem(mined,1)
- for i = 1, 5 do
- -- debris stuff
- local partdebris = Instance.new("Part",script)
- partdebris.Shape = Enum.PartType.Ball
- partdebris.Size = Vector3.new(0.25,0.25,0.25)
- partdebris.Color = oldpartcolor
- local Mesh = Instance.new("SpecialMesh")
- Mesh.Parent = partdebris
- Mesh.MeshType = "Brick"
- Mesh.Scale = Vector3.new(1, 1, 1)
- partdebris.CanTouch = false
- partdebris.Material = Enum.Material.SmoothPlastic
- partdebris.CFrame = oldcf * CFrame.new(math.random(-1,1),math.random(-1,1),math.random(-1,1))
- partdebris:ApplyImpulse(CFrame.new(oldcf.Position,partdebris.Position).lookVector * 0.0625)
- debris:AddItem(partdebris,6)
- end
- end
- end
- end)
- NLS([[
- local Tool = owner.Character:WaitForChild("builder")
- local buildremote = owner.Character:WaitForChild("The")
- local mouse = owner:GetMouse()
- local off = false
- local equipped = false
- local posx
- local posy
- local posz
- Brick2 = Instance.new("Part", owner.Character) -- cursor hover
- Brick2.Size = Vector3.new(2.5,2.5,2.5)
- Brick2.Anchored = true
- Brick2.Material = Enum.Material.SmoothPlastic
- Brick2.Transparency = 0.65
- Brick2.CanCollide = false
- oldcolor = Brick2.Color
- local gridsize = 2.5
- building = true
- game:GetService("RunService").RenderStepped:Connect(function() -- constant mouse update
- if building then
- posx = math.floor(mouse.Hit.X/gridsize + 0.5) * gridsize
- posy = math.floor(mouse.Hit.Y/gridsize + 0.5) * gridsize
- posz = math.floor(mouse.Hit.Z/gridsize + 0.5) * gridsize
- local pos2 = Vector3.new(posx,posy,posz)
- Brick2.Position = pos2
- elseif not building then
- Brick2.Position = mouse.Target.Position
- end
- end)
- mouse.Button1Down:Connect(function()
- if building then
- local pos = Vector3.new(posx,posy,posz)
- buildremote:FireServer("Build", pos)
- elseif not building then
- buildremote:FireServer("Destroy", mouse.Target)
- end
- end)
- count = 0
- function buildswitch(key) -- switching from destroy to build or build to destroy
- key = key:lower()
- if key == "q" then
- count = count + 1
- if count == 1 then
- building = false
- Brick2.Color = Color3.fromRGB(184, 65, 65)
- Brick2.Size = Vector3.new(2.6,2.6,2.6)
- elseif count == 2 then
- building = true
- Brick2.Color = oldcolor
- Brick2.Size = Vector3.new(2.5,2.5,2.5)
- task.wait()
- count = 0
- end
- end
- end
- mouse.KeyDown:Connect(buildswitch)
- ]], owner.Character)
- print([["Q is to change between
- building or destroying"]])
- print("Click to make or break a part")
- warn("DIAMONDS AAAAAAAAAAAA")
- warn("Made by Haker Man / Lucas_YT111")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement