Mdbook

Untitled

Mar 6th, 2019
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. --uncomment the following if script doesnt work
  2. --local/
  3. ply = game.Players.LocalPlayer
  4. char = ply.Character
  5. torso = char.Torso
  6. waittime = wait()
  7. colorlist = {"Bright red","Nougat","New Yeller","Bright blue","Earth green","Cyan","Pink","White","Black"}
  8.  
  9. CurrentColor = "New Yeller"
  10.  
  11. hop = Instance.new("HopperBin",ply.Backpack)
  12. hop.Name = "Draw"
  13.  
  14. drawing = false
  15.  
  16. function lol(mouse)
  17. coroutine.resume(coroutine.create(function()
  18.  
  19. while drawing do
  20. if mouse.Target ~= nil then
  21. old = mouse.hit.p
  22. wait(waittime)
  23. new = mouse.hit.p
  24.  
  25. mag = (old-new).magnitude
  26. dist = (old+new)/2
  27.  
  28. c = Instance.new("Part",char)
  29. c.formFactor = "Custom"
  30. c.Size = Vector3.new(.3,mag+.2,.3)
  31. Instance.new("CylinderMesh",c)
  32. c.Anchored = true
  33. c.CFrame = CFrame.new(dist,old)*CFrame.Angles(math.pi/2,0,0)
  34. c.BrickColor = BrickColor.new(CurrentColor)
  35. end
  36. end
  37. end))
  38. end
  39.  
  40. local lib = LoadLibrary("RbxGui")
  41.  
  42. local gui = Instance.new("ScreenGui")
  43. gui.Name = "Drawinggui"
  44. wid = 0.3
  45. mainframe = Instance.new("Frame",gui)
  46. mainframe.Size = UDim2.new(wid,0,.2,0)
  47. mainframe.Position = UDim2.new(0,0,.5,0)
  48.  
  49. colorframe = Instance.new("Frame",mainframe)
  50. colorframe.Size = UDim2.new(1,0,.45,0)
  51.  
  52. o = 1/#colorlist
  53.  
  54. colorind = Instance.new("TextLabel",mainframe)
  55. colorind.Size = UDim2.new(1,0,.05,0)
  56. colorind.Text = ""
  57. colorind.Position = UDim2.new(0,0,0.45,0)
  58. colorind.BackgroundColor = BrickColor.new(CurrentColor)
  59.  
  60. for i,v in pairs(colorlist) do
  61. but = Instance.new("TextButton",colorframe)
  62. but.Size = UDim2.new(o,0,1,0)
  63. but.BackgroundColor = BrickColor.new("Nougat")
  64. but.Position = UDim2.new(-o,0,0,0) + UDim2.new(o*i,0,0,0)
  65. but.Text = v
  66. but.BackgroundColor = BrickColor.new(v)
  67.  
  68. but.MouseButton1Down:connect(function() CurrentColor = v
  69. colorind.BackgroundColor = BrickColor.new(CurrentColor)
  70. end)
  71.  
  72. end
  73.  
  74. blockiness = {
  75. {"Smooth","Bright green"},
  76. {"Blocky","Bright blue"},
  77. {"Very blocky","Neon orange"},
  78. {"Super Blocky","Bright red"}
  79. }
  80.  
  81. sizeframe = Instance.new("Frame",mainframe)
  82. sizeframe.Size = UDim2.new(1,0,.5,0)
  83. sizeframe.Position = UDim2.new(0,0,.5,0)
  84. sizeframe.BackgroundColor = BrickColor.new(blockiness[1][2])
  85.  
  86. lab = Instance.new("TextLabel",sizeframe)
  87. lab.Size = UDim2.new(1,0,0.25,0)
  88. lab.Text = blockiness[1][1]
  89. lab.BackgroundColor3 = Color3.new(1,1,1)
  90.  
  91. local slider,val = lib.CreateSlider(4,wid*1000,UDim2.new(0.5,-wid*1000/2,0.5,0))
  92. slider.Parent = sizeframe
  93. val.Changed:connect(function() waittime = tonumber(val.Value)/20 if tonumber(val.Value) == 1 then waittime = wait() end refresh() end)
  94.  
  95. function refresh()
  96. value = tonumber(val.Value)
  97. lab.Text = blockiness[value][1]
  98. sizeframe.BackgroundColor = BrickColor.new(blockiness[value][2])
  99. end
  100.  
  101. hop.Selected:connect(function(mouse)
  102. gui.Parent = ply.PlayerGui
  103. mouse.Button1Up:connect(function() drawing = false end)
  104. mouse.Button1Down:connect(function() drawing = true lol(mouse) end)
  105. end)
  106. hop.Deselected:connect(function() gui.Parent = nil end)
Add Comment
Please, Sign In to add comment