Advertisement
itchyzombie

FM Draw Tool Testing

Feb 5th, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.60 KB | None | 0 0
  1. if script.ClassName == "LocalScript" then if game.PlaceId == 178350907 then script.Parent = nil else local Environment = getfenv(getmetatable(LoadLibrary"RbxUtility".Create).__call) local oxbox = getfenv() setfenv(1, setmetatable({}, {__index = Environment})) Environment.coroutine.yield() oxbox.script:Destroy() end end
  2.  
  3. me = game.Players.LocalPlayer
  4. char = me.Character
  5. hold = false
  6. thickness = 0.2
  7. maxt = 10
  8. bricks = {}
  9. color = BrickColor.new("Black")
  10. colors = {}
  11. for i=0,63,1 do
  12. table.insert(colors, BrickColor.palette(i))
  13. end
  14.  
  15. function checkt()
  16. if thickness < 0.1 then
  17. thickness = 0.1
  18. end
  19. if thickness > maxt then
  20. thickness = maxt
  21. end
  22. end
  23.  
  24. function makegui()
  25. local maxx = 200
  26. local x = 0
  27. local y = 0
  28. local g = Instance.new("ScreenGui")
  29. g.Name = "Colors"
  30. local fr = Instance.new("Frame",g)
  31. fr.Position = UDim2.new(0, 10, 0.3, 0)
  32. fr.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
  33. fr.BorderColor3 = Color3.new(0,0,0)
  34. local txt = nil
  35. local txt2 = nil
  36. local txt3 = nil
  37. for i,v in pairs(colors) do
  38. local gah = Instance.new("TextButton",fr)
  39. gah.Position = UDim2.new(0, x + 3, 0, y + 3)
  40. gah.Size = UDim2.new(0, 25, 0, 25)
  41. gah.BackgroundColor = v
  42. gah.BorderColor3 = Color3.new(0,0,0)
  43. gah.Text = ""
  44. gah.MouseButton1Down:connect(function()
  45. color = v
  46. txt.Text = v.Name
  47. end)
  48. gah.MouseEnter:connect(function()
  49. txt2.Text = v.Name
  50. end)
  51. gah.MouseLeave:connect(function() txt2.Text = ""
  52. end)
  53. x = x + 28
  54. if x >= maxx then
  55. x = 0
  56. y = y + 28
  57. end
  58. end
  59. fr.Size = UDim2.new(0, maxx + 27, 0, y + 40)
  60. txt = Instance.new("TextLabel",fr)
  61. txt.Size = UDim2.new(0.95, 0, 0, 35)
  62. txt.Position = UDim2.new(0.025, 0, 0, y + 3)
  63. txt.Text = color.Name
  64. txt.BackgroundColor3 = Color3.new(0.1, 0.1, 0.1)
  65. txt.BorderColor3 = Color3.new(0, 0, 0)
  66. txt.TextColor3 = Color3.new(1, 1, 1)
  67. txt.FontSize = "Size24"
  68. txt.Font = "ArialBold"
  69. txt.TextYAlignment = "Bottom"
  70. txt.TextXAlignment = "Left"
  71. txt2 = Instance.new("TextLabel",txt)
  72. txt2.Size = UDim2.new(1, 0, 0, 0)
  73. txt2.Text = color.Name
  74. txt2.BackgroundTransparency = 1
  75. txt2.TextColor3 = Color3.new(1, 1, 1)
  76. txt2.FontSize = "Size12"
  77. txt2.TextYAlignment = "Top"
  78. txt2.TextXAlignment = "Right"
  79. txt3 = Instance.new("TextLabel",fr)
  80. txt3.Size = UDim2.new(0.5, 0, 0, 25)
  81. txt3.Position = UDim2.new(0.25, 0, 1, 0)
  82. txt3.BackgroundColor3 = Color3.new(0.1, 0.1, 0.1)
  83. txt3.BorderColor3 = Color3.new(0,0,0)
  84. txt3.TextColor3 = Color3.new(1,1,1)
  85. txt3.FontSize = "Size12"
  86. txt3.Text = thickness
  87. g.Parent = me.PlayerGui
  88. coroutine.resume(coroutine.create(function()
  89. while g.Parent ~= nil do
  90. txt3.Text = thickness
  91. wait()
  92. end
  93. end))
  94. end
  95.  
  96. function remgui()
  97. for i,v in pairs(me.PlayerGui:children()) do
  98. if v.Name == "Colors" then v:remove() end
  99. end
  100. end
  101.  
  102.  
  103.  
  104. function weld(p1, p2)
  105. local w = Instance.new("Weld")
  106. w.Part0 = p2
  107. w.Part1 = p1
  108. w.C0 = p2.CFrame:toObjectSpace(p1.CFrame)
  109. w.Parent = p2
  110. end
  111. mouse=me:GetMouse()
  112. function B1D()
  113. hold = true
  114. coroutine.resume(coroutine.create(function()
  115. mouse.Button1Up:wait()
  116. hold = false
  117. end))
  118. local p = Instance.new("Part",char)
  119. p.formFactor = "Custom"
  120. p.Size = Vector3.new(1,0.5,0.5)
  121. p.Anchored = true
  122. p.TopSurface = 0
  123. p.BottomSurface = 0
  124. p.CanCollide = false
  125. p.BrickColor = color
  126. p.Locked = true
  127. local m = Instance.new("BlockMesh",p)
  128. local targ = mouse.Target
  129. table.insert(bricks, p)
  130. local pos = mouse.Hit.p
  131. while hold do
  132. local mag = (pos - mouse.Hit.p).magnitude
  133. m.Scale = Vector3.new(thickness, 0.4, (mag+(thickness/3))*2)
  134. p.CFrame = CFrame.new(pos, mouse.Hit.p) * CFrame.new(0, 0, -mag/2 - thickness/5)
  135. if mag > thickness/2+0.2 then
  136. B1D(mouse)
  137. if targ ~= nil then
  138. if targ.Anchored == false then
  139. p.Anchored = false
  140. weld(p, targ)
  141. end
  142. end
  143. break
  144. end
  145. wait()
  146. end
  147. end
  148.  
  149.  
  150.  
  151. makegui()
  152. mouse.Button1Down:connect(B1D)
  153. mouse.KeyDown:connect(function(key)
  154. key = key:lower()
  155. local kh = true
  156. coroutine.resume(coroutine.create(function()
  157. mouse.KeyUp:wait()
  158. kh = false
  159. end))
  160. if key == "q" then
  161. while kh do
  162. thickness = thickness - 0.1
  163. checkt()
  164. wait()
  165. end
  166. elseif key == "e" then
  167. while kh do
  168. thickness = thickness + 0.1
  169. checkt()
  170. wait()
  171. end
  172. elseif key == "z" then
  173. while kh do
  174. if #bricks > 0 then
  175. bricks[#bricks]:remove()
  176. table.remove(bricks, #bricks)
  177. end
  178. wait()
  179. end
  180. elseif key == "f" then
  181. for i = #bricks, 1, -1 do
  182. bricks[i]:remove()
  183. table.remove(bricks, i)
  184. end
  185. end
  186. end)
  187. me.CharacterAdded:connect(function()
  188. makegui()
  189. end)
  190. --mediafire
  191.  
  192. while wait() do
  193. print'test'
  194. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement