Advertisement
ohhhhhhshdhashdahsd

Epic build tools

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