Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bin = script.Parent
- local trans = 0
- local draw = false
- local objects = {}
- local color = 23
- local height = 0.6
- --Set cursor--~
- local curs = Instance.new("Part")
- curs.formFactor = "Plate"
- curs.Shape = "Ball"
- curs.BrickColor = BrickColor.new(26)
- curs.Size = Vector3.new(1,0.4,1)
- -----------------~
- function sa(msg)
- local ms = Instance.new("Message")
- ms.Parent = bin.Parent.Parent
- ms.Text = msg
- wait(1)
- ms:remove()
- end
- function move(mouse)
- curs.Position = Vector3.new(mouse.Hit.p.x, 0.7, mouse.Hit.p.z)
- end
- function onKeyDown(key)
- key = key:lower()
- if key == "t" then
- trans = trans + 0.1
- sa(trans)
- end
- if key == "g" then
- trans = trans - 0.1
- sa(trans)
- end
- if key == "c" then
- local g = game.Workspace:getChildren()
- for i = 1, #g do
- if g[i].Name == ("Brick" ..bin.Parent.Parent.Name) then
- g[i]:Remove()
- end
- end
- end
- if key == "r" then
- if color == 23 then
- color = 21
- sa("Red")
- elseif color == 21 then
- color = 37
- sa("Green")
- elseif color == 37 then
- color = 108
- sa("Brown")
- elseif color == 108 then
- color = 1
- sa("White")
- elseif color == 1 then
- color = 26
- sa("Black")
- else
- color = 23
- sa("Blue")
- end
- end
- end
- function onButton1Down(mouse)
- curs.BrickColor = BrickColor.new(21)
- draw = true
- while draw do
- local part = Instance.new("Part")
- part.Name = "Brick" ..bin.Parent.Parent.Name
- part.formFactor = "Plate"
- part.Size = Vector3.new(1,.4,1)
- part.Position = mouse.Hit.p
- part.Position = Vector3.new(part.Position.x, 0.6, part.Position.z)
- part.Transparency = trans
- part.Anchored = true
- part.BrickColor = BrickColor.new(color)
- part.Parent = game.Workspace
- part:BreakJoints()
- wait()
- end
- end
- function onButton1Up(mouse)
- curs.BrickColor = BrickColor.new(26)
- draw = false
- end
- function onSelected(mouse)
- color = 23
- curs.Parent = game.Workspace
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- mouse.Button1Down:connect(function() onButton1Down(mouse) end)
- mouse.Button1Up:connect(function() onButton1Up(mouse) end)
- mouse.Idle:connect(function() move(mouse) end)
- mouse.KeyDown:connect(onKeyDown)
- sa("To change color, Push 'r'.")
- sa("To change transparency, Push t to raise; g to lower.")
- sa("To restart, push c.")
- end
- function unSelected(mouse)
- curs:remove()
- end
- function onF()
- if bin == nil then
- curs:Remove()
- end
- end
- bin.Selected:connect(onSelected)
- bin.Deselected:connect(unSelected)
- bin.Parent.ChildRemoved:connect(onF)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement