SHOW:
|
|
- or go back to the newest paste.
1 | - | me = game.Players.XTheShowcaserX --add your name here CLICK "Q" to see the settings |
1 | + | me = game.Players.WinslowMau --add your name here CLICK "Q" to see the settings |
2 | ||
3 | if script.Parent.className ~= "HopperBin" then | |
4 | h = Instance.new("HopperBin") | |
5 | h.Parent = me.Backpack | |
6 | h.Name = "Build IT" | |
7 | script.Parent = h | |
8 | end | |
9 | ||
10 | bin = script.Parent | |
11 | hold = false | |
12 | sel = false | |
13 | ||
14 | color = "Black" | |
15 | material = "Plastic" | |
16 | x = 1 | |
17 | y = 1 | |
18 | tran = 0 | |
19 | ref = 0 | |
20 | ||
21 | colours = {} | |
22 | materials = {"Plastic", "Wood", "Slate", "CorrodedMetal", "Concrete", "Ice", "Foil", "Grass", "DiamondPlate"} | |
23 | floor = {} | |
24 | ||
25 | for i=1,1032 do | |
26 | if BrickColor.new(i) ~= BrickColor.new("Medium stone grey") then | |
27 | table.insert(colours, tostring(BrickColor.new(i))) | |
28 | end | |
29 | end | |
30 | ||
31 | brick = Instance.new("Part") | |
32 | brick.Parent = bin | |
33 | brick.formFactor = 0 | |
34 | brick.Size = Vector3.new(1,1,1) | |
35 | brick.Anchored = true | |
36 | brick.BrickColor = BrickColor.new(color) | |
37 | brick.TopSurface = 0 | |
38 | brick.BottomSurface = 0 | |
39 | brick.Material = material | |
40 | brick.CanCollide = false | |
41 | brick.Transparency = tran | |
42 | brick.Reflectance = ref | |
43 | brick.Size = Vector3.new(x,y,1) | |
44 | sph = Instance.new("SpecialMesh",brick) | |
45 | sph.MeshType = "Brick" | |
46 | sph.Scale = Vector3.new(x,y,1) | |
47 | ||
48 | mode = "Build" | |
49 | gui = false | |
50 | ||
51 | function lollero(vector) | |
52 | return Vector3.new(math.ceil(vector.x - 0.5), math.ceil(vector.y - 0.5), math.ceil(vector.z - 0.5)) | |
53 | end | |
54 | ||
55 | function makegui() | |
56 | if gui == true then return end | |
57 | screen = Instance.new("ScreenGui") | |
58 | screen.Parent = me.PlayerGui | |
59 | screen.Name = "Build GUI" | |
60 | frame = Instance.new("Frame") | |
61 | frame.Parent = screen | |
62 | frame.Size = UDim2.new(1,0,0.078,0) | |
63 | frame.Position = UDim2.new(0,0,0,-1) | |
64 | frame.BackgroundColor3 = Color3.new(0.05,0.05,0.05) | |
65 | frame.BorderColor3 = Color3.new(0.17,0.17,0.17) | |
66 | local xx = 0.045 | |
67 | local yy = 0.1 | |
68 | for i=1, #colours do | |
69 | local button = Instance.new("TextButton",frame) | |
70 | button.Size = UDim2.new(0.014,0,0.26,0) | |
71 | button.Position = UDim2.new(xx,0,yy,0) | |
72 | button.BackgroundColor = BrickColor.new(colours[i]) | |
73 | button.BorderSizePixel = 0 | |
74 | button.Text = "" | |
75 | button.MouseButton1Click:connect(function() | |
76 | color = colours[i] | |
77 | end) | |
78 | xx = xx + 0.016 | |
79 | if xx > 0.8 then | |
80 | xx = 0.045 | |
81 | yy = yy + 0.3 | |
82 | end | |
83 | end | |
84 | frame2 = Instance.new("Frame") | |
85 | frame2.Parent = screen | |
86 | frame2.Size = UDim2.new(0.1,0,1,0) | |
87 | frame2.Position = UDim2.new(0.9,0,0,-1) | |
88 | frame2.BackgroundColor3 = Color3.new(0.05,0.05,0.05) | |
89 | frame2.BorderColor3 = Color3.new(0.17,0.17,0.17) | |
90 | local yyy = 0.14 | |
91 | for i=1, #materials do | |
92 | local butta = Instance.new("TextButton",frame2) | |
93 | butta.Size = UDim2.new(0.8,0,0.06,0) | |
94 | butta.Position = UDim2.new(0.1,0,yyy,0) | |
95 | butta.BackgroundColor3 = Color3.new(0.1,0.1,0.1) | |
96 | butta.Text = materials[i] | |
97 | butta.BorderColor3 = Color3.new(0.2,0.2,0.2) | |
98 | butta.TextColor3 = Color3.new(1,1,1) | |
99 | butta.MouseButton1Click:connect(function() | |
100 | material = materials[i] | |
101 | end) | |
102 | yyy = yyy + 0.067 | |
103 | end | |
104 | floorbutton = Instance.new("TextButton",frame2) | |
105 | floorbutton.Size = UDim2.new(0.9,0,0.07,0) | |
106 | floorbutton.Position = UDim2.new(0.05,0,0.8,0) | |
107 | floorbutton.BackgroundColor3 = Color3.new(0.1,0.1,0.1) | |
108 | floorbutton.Text = "Done" | |
109 | floorbutton.BorderColor3 = Color3.new(0.2,0.2,0.2) | |
110 | floorbutton.TextColor3 = Color3.new(1,1,1) | |
111 | floorbutton.FontSize = "Size14" | |
112 | floorbutton.MouseButton1Click:connect(function() | |
113 | for i=1, #floor do | |
114 | floor[i].Parent = workspace | |
115 | end | |
116 | for i=1, #floor do | |
117 | table.remove(floor,1) | |
118 | end | |
119 | end) | |
120 | instructions = Instance.new("Frame",screen) | |
121 | instructions.Size = UDim2.new(1,0,0.08,0) | |
122 | instructions.Position = UDim2.new(0,0,0.92,0) | |
123 | instructions.BackgroundColor3 = Color3.new(0.1,0.1,0.1) | |
124 | text1 = Instance.new("TextLabel",instructions) | |
125 | text1.Size = UDim2.new(1,0,0.4,0) | |
126 | text1.Position = UDim2.new(0,0,0,0) | |
127 | text1.BackgroundTransparency = 1 | |
128 | text1.FontSize = "Size18" | |
129 | text1.TextColor3 = Color3.new(1,1,1) | |
130 | text1.Text = "R, T, Z, X to resize, Y and U for transparency, E to remove gui." | |
131 | text2 = Instance.new("TextLabel",instructions) | |
132 | text2.Size = UDim2.new(1,0,0.4,0) | |
133 | text2.Position = UDim2.new(0,0,0.5,0) | |
134 | text2.BackgroundTransparency = 1 | |
135 | text2.FontSize = "Size18" | |
136 | text2.TextColor3 = Color3.new(1,1,1) | |
137 | text2.Text = "B for build mode, F for deleting mode, M for edit mode." | |
138 | gui = true | |
139 | end | |
140 | ||
141 | bin.Selected:connect(function(mouse) | |
142 | sel = true | |
143 | brick.Parent = me.Character | |
144 | brick.CFrame = CFrame.new(mouse.Hit.p) | |
145 | coroutine.resume(coroutine.create(function() | |
146 | while sel do | |
147 | wait() | |
148 | brick.CFrame = CFrame.new(lollero(mouse.Hit.p)) * CFrame.new(0,y/2,0) | |
149 | brick.BrickColor = BrickColor.new(color) | |
150 | brick.Material = material | |
151 | brick.Transparency = tran | |
152 | brick.Reflectance = ref | |
153 | sph.Scale = Vector3.new(x,y,1) | |
154 | end | |
155 | end)) | |
156 | mouse.KeyDown:connect(function(key) | |
157 | key = key:lower() | |
158 | if key == "q" then | |
159 | makegui() | |
160 | elseif key == "e" then | |
161 | local a = me.PlayerGui:GetChildren() | |
162 | for _,v in pairs(a) do | |
163 | if v.Name == "Build GUI" then | |
164 | v:remove() | |
165 | gui = false | |
166 | end | |
167 | end | |
168 | elseif key == "z" then | |
169 | if x > 1 then | |
170 | x = x - 1 | |
171 | end | |
172 | elseif key == "x" then | |
173 | x = x + 1 | |
174 | elseif key == "r" then | |
175 | if y > 1 then | |
176 | y = y - 1 | |
177 | end | |
178 | elseif key == "t" then | |
179 | y = y + 1 | |
180 | elseif key == "f" then | |
181 | mode = "Delete" | |
182 | elseif key == "b" then | |
183 | mode = "Build" | |
184 | elseif key == "m" then | |
185 | mode = "Edit" | |
186 | elseif key == "y" then | |
187 | tran = tran - 0.1 | |
188 | if tran < 0 then | |
189 | tran = 0 | |
190 | end | |
191 | elseif key == "u" then | |
192 | tran = tran + 0.1 | |
193 | if tran > 1 then | |
194 | tran = 1 | |
195 | end | |
196 | end | |
197 | end) | |
198 | mouse.Button1Down:connect(function() | |
199 | if mode == "Build" then | |
200 | if mouse.Target == nil then return end | |
201 | hold = true | |
202 | holdem = lollero(mouse.Hit.p) | |
203 | holdposition = holdem + Vector3.new(0,y/2,0) | |
204 | possa = holdposition | |
205 | local buildbrick = Instance.new("Part",me.Character) | |
206 | buildbrick.Name = "BuildBrick" | |
207 | buildbrick.formFactor = "Custom" | |
208 | buildbrick.Size = Vector3.new(x,y,1) | |
209 | buildbrick.TopSurface = 0 | |
210 | buildbrick.BottomSurface = 0 | |
211 | buildbrick.Anchored = true | |
212 | buildbrick.BrickColor = BrickColor.new(color) | |
213 | buildbrick.Transparency = tran | |
214 | buildbrick.Reflectance = ref | |
215 | buildbrick.Material = material | |
216 | buildbrick.CFrame = CFrame.new(holdposition) | |
217 | table.insert(floor,buildbrick) | |
218 | while hold do | |
219 | holdposition = holdem + Vector3.new(0,y/2,0) | |
220 | local poo = lollero(mouse.Hit.p) | |
221 | possa = poo + Vector3.new(0,y/2,0) | |
222 | local distance = (holdposition - possa).magnitude | |
223 | if distance > 600 then | |
224 | distance = 600 | |
225 | end | |
226 | buildbrick.Size = Vector3.new(x,y,distance) | |
227 | buildbrick.CFrame = CFrame.new((possa + holdposition)/2, holdposition) | |
228 | wait() | |
229 | end | |
230 | elseif mode == "Delete" then | |
231 | if mouse.Target then | |
232 | local targ = mouse.Target | |
233 | if targ.Name == "BuildBrick" then | |
234 | targ:remove() | |
235 | end | |
236 | end | |
237 | elseif mode == "Edit" then | |
238 | if mouse.Target then | |
239 | local targ = mouse.Target | |
240 | if targ.Name == "BuildBrick" then | |
241 | targ.BrickColor = BrickColor.new(color) | |
242 | targ.Material = material | |
243 | targ.Transparency = tran | |
244 | targ.Reflectance = ref | |
245 | end | |
246 | end | |
247 | end | |
248 | end) | |
249 | mouse.Button1Up:connect(function() | |
250 | hold = false | |
251 | end) | |
252 | end) | |
253 | ||
254 | bin.Deselected:connect(function() | |
255 | hold = false | |
256 | sel = false | |
257 | brick.Parent = bin | |
258 | end) |