Advertisement
AsukaOS

Fe Draw Tools

Sep 20th, 2018
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.62 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code by Mokiros")
  7. local rp = RealPlayer
  8. script.Parent = rp.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent then
  34. for _,f in pairs(t.Functions) do
  35. f(...)
  36. end
  37. end
  38. end
  39. m.TrigEvent = te
  40. UIS.TrigEvent = te
  41.  
  42. Event.OnServerEvent:Connect(function(plr,io)
  43. if plr~=rp then return end
  44. m.Target = io.Target
  45. m.Hit = io.Hit
  46. if not io.isMouse then
  47. local b = io.UserInputState == Enum.UserInputState.Begin
  48. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  49. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  50. end
  51. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  52. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  53. end
  54. for _,t in pairs(CAS.Actions) do
  55. for _,k in pairs(t.Keys) do
  56. if k==io.KeyCode then
  57. t.Function(t.Name,io.UserInputState,io)
  58. end
  59. end
  60. end
  61. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  62. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  63. end
  64. end)
  65. Event.Parent = NLS([==[
  66. local Player = game:GetService("Players").LocalPlayer
  67. local Event = script:WaitForChild("UserInput_Event")
  68.  
  69. local Mouse = Player:GetMouse()
  70. local UIS = game:GetService("UserInputService")
  71. local input = function(io,a)
  72. if a then return end
  73. --Since InputObject is a client-side instance, we create and pass table instead
  74. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  75. end
  76. UIS.InputBegan:Connect(input)
  77. UIS.InputEnded:Connect(input)
  78.  
  79. local h,t
  80. --Give the server mouse data 30 times every second, but only if the values changed
  81. --If player is not moving their mouse, client won't fire events
  82. while wait(1/30) do
  83. if h~=Mouse.Hit or t~=Mouse.Target then
  84. h,t=Mouse.Hit,Mouse.Target
  85. Event:FireServer({isMouse=true,Target=t,Hit=h})
  86. end
  87. end]==],Player.Character)
  88.  
  89. ----Sandboxed game object that allows the usage of client-side methods and services
  90. --Real game object
  91. local _rg = game
  92.  
  93. --Metatable for fake service
  94. local fsmt = {
  95. __index = function(self,k)
  96. local s = rawget(self,"_RealService")
  97. if s then
  98. return typeof(s[k])=="function"
  99. and function(_,...)return s[k](s,...)end or s[k]
  100. end
  101. end,
  102. __newindex = function(self,k,v)
  103. local s = rawget(self,"_RealService")
  104. if s then s[k]=v end
  105. end
  106. }
  107. local function FakeService(t,RealService)
  108. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  109. return setmetatable(t,fsmt)
  110. end
  111.  
  112. --Fake game object
  113. local g = {
  114. GetService = function(self,s)
  115. return rawget(self,s) or _rg:GetService(s)
  116. end,
  117. Players = FakeService({
  118. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  119. },"Players"),
  120. UserInputService = FakeService(UIS,"UserInputService"),
  121. ContextActionService = FakeService(CAS,"ContextActionService"),
  122. RunService = FakeService({
  123. _btrs = {},
  124. RenderStepped = _rg:GetService("RunService").Heartbeat,
  125. BindToRenderStep = function(self,name,_,fun)
  126. self._btrs[name] = self.Heartbeat:Connect(fun)
  127. end,
  128. UnbindFromRenderStep = function(self,name)
  129. self._btrs[name]:Disconnect()
  130. end,
  131. },"RunService")
  132. }
  133. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  134. g.service = g.GetService
  135. FakeService(g,game)
  136. --Changing owner to fake player object to support owner:GetMouse()
  137. game,owner = g,g.Players.LocalPlayer
  138. end
  139. -- Toggle : [=] (enable / disable drawing)
  140. -- Undo : [Z] (remove last drawn line in canvas)
  141. -- Draw : [Left Click] (draw)
  142. -- Clear : [F] (clear canvas)
  143. -- Rainbow : [R] (toggle rainbow color drawings)
  144. -- Neon Glow : [X] (toggle glowing drawings)
  145. -- Other in GUI
  146. -- Toxicity : [Q] (toggle toxicity aka kills people)
  147.  
  148. local plr = game:GetService("Players").LocalPlayer
  149. char = plr.Character
  150. mouse = plr:GetMouse()
  151.  
  152. function tween(object,style,direction,t,goal)
  153. local tweenservice = game:GetService("TweenService")
  154. local tweenInfo = TweenInfo.new(t,Enum.EasingStyle[style],Enum.EasingDirection[direction])
  155. local tween = tweenservice:Create(object,tweenInfo,goal)
  156. tween:Play()
  157. return tween
  158. end
  159.  
  160. enabled = true
  161.  
  162. local pgui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  163.  
  164. GUI = Instance.new("ScreenGui")
  165. GUI.ResetOnSpawn = false
  166. Frame1 = Instance.new("Frame")
  167. TextLabel2 = Instance.new("TextLabel")
  168. Frame3 = Instance.new("Frame")
  169. Frame4 = Instance.new("Frame")
  170. Frame5 = Instance.new("Frame")
  171. Frame6 = Instance.new("Frame")
  172. TextLabel7 = Instance.new("TextLabel")
  173. TextLabel8 = Instance.new("TextLabel")
  174. TextLabel9 = Instance.new("TextLabel")
  175. TextLabel10 = Instance.new("TextLabel")
  176. Frame11 = Instance.new("Frame")
  177. Frame12 = Instance.new("Frame")
  178. Frame13 = Instance.new("Frame")
  179. Frame14 = Instance.new("Frame")
  180. Frame15 = Instance.new("Frame")
  181. Frame16 = Instance.new("Frame")
  182. ImageButton17 = Instance.new("ImageButton")
  183. TextLabel18 = Instance.new("TextLabel")
  184. ImageButton19 = Instance.new("ImageButton")
  185. LocalScript20 = Instance.new("LocalScript")
  186. Color3Value21 = Instance.new("Color3Value")
  187. TextLabel22 = Instance.new("TextLabel")
  188. TextLabel23 = Instance.new("TextLabel")
  189. TextLabel24 = Instance.new("TextLabel")
  190. TextLabel25 = Instance.new("TextLabel")
  191. GUI.Parent = pgui
  192. Frame1.Name = "Settings"
  193. Frame1.Parent = GUI
  194. Frame1.Transparency = 0.80000001192093
  195. Frame1.Size = UDim2.new(0, 191, 0, 130)
  196. Frame1.Position = UDim2.new(0, 266, 0, 130)
  197. Frame1.Active = true
  198. Frame1.BackgroundColor3 = Color3.new(0.0470588, 0.0509804, 0.0588235)
  199. Frame1.BackgroundTransparency = 0.80000001192093
  200. Frame1.BorderColor3 = Color3.new(1, 1, 1)
  201. Frame1.BorderSizePixel = 0
  202. Frame1.Draggable = true
  203. TextLabel2.Parent = Frame1
  204. TextLabel2.Size = UDim2.new(0, 191, 0, 15)
  205. TextLabel2.Text = "Neodymn's Draw Tool"
  206. TextLabel2.Position = UDim2.new(0, 0, 0, 5)
  207. TextLabel2.BackgroundColor3 = Color3.new(1, 1, 1)
  208. TextLabel2.BackgroundTransparency = 1
  209. TextLabel2.Font = Enum.Font.SourceSansBold
  210. TextLabel2.TextSize = 22
  211. TextLabel2.TextColor3 = Color3.new(1, 1, 1)
  212. TextLabel2.TextStrokeColor3 = Color3.new(1, 1, 1)
  213. TextLabel2.TextWrapped = false
  214. Frame3.Parent = Frame1
  215. Frame3.Size = UDim2.new(0, 3, 1, 0)
  216. Frame3.Position = UDim2.new(0, -3, 0, 0)
  217. Frame3.BackgroundColor3 = Color3.new(1, 1, 1)
  218. Frame3.BorderSizePixel = 0
  219. Frame4.Parent = Frame1
  220. Frame4.Size = UDim2.new(0, 3, 1, 0)
  221. Frame4.Position = UDim2.new(1, 0, 0, 0)
  222. Frame4.BackgroundColor3 = Color3.new(1, 1, 1)
  223. Frame4.BorderSizePixel = 0
  224. Frame5.Parent = Frame1
  225. Frame5.Size = UDim2.new(1, 0, 0, 3)
  226. Frame5.Position = UDim2.new(0, 0, 0, -3)
  227. Frame5.BackgroundColor3 = Color3.new(1, 1, 1)
  228. Frame5.BorderSizePixel = 0
  229. Frame6.Parent = Frame1
  230. Frame6.Size = UDim2.new(1, 0, 0, 3)
  231. Frame6.Position = UDim2.new(0, 0, 1, 0)
  232. Frame6.BackgroundColor3 = Color3.new(1, 1, 1)
  233. Frame6.BorderSizePixel = 0
  234. TextLabel7.Parent = Frame1
  235. TextLabel7.Size = UDim2.new(0, 95, 0, 25)
  236. TextLabel7.Text = "Thickness (m/n)"
  237. TextLabel7.Position = UDim2.new(0, 5, 0, 25)
  238. TextLabel7.BackgroundColor3 = Color3.new(1, 1, 1)
  239. TextLabel7.BackgroundTransparency = 1
  240. TextLabel7.Font = Enum.Font.SourceSansBold
  241. TextLabel7.TextSize = 20
  242. TextLabel7.TextColor3 = Color3.new(1, 1, 1)
  243. TextLabel7.TextStrokeColor3 = Color3.new(1, 1, 1)
  244. TextLabel7.TextXAlignment = Enum.TextXAlignment.Left
  245. TextLabel8.Parent = Frame1
  246. TextLabel8.Size = UDim2.new(0, 95, 0, 25)
  247. TextLabel8.Text = "Can Collide (c)"
  248. TextLabel8.Position = UDim2.new(0, 5, 0, 50)
  249. TextLabel8.BackgroundColor3 = Color3.new(1, 1, 1)
  250. TextLabel8.BackgroundTransparency = 1
  251. TextLabel8.Font = Enum.Font.SourceSansBold
  252. TextLabel8.TextSize = 20
  253. TextLabel8.TextColor3 = Color3.new(1, 1, 1)
  254. TextLabel8.TextStrokeColor3 = Color3.new(1, 1, 1)
  255. TextLabel8.TextXAlignment = Enum.TextXAlignment.Left
  256. TextLabel9.Parent = Frame1
  257. TextLabel9.Size = UDim2.new(0, 95, 0, 25)
  258. TextLabel9.Text = "Opacity (b/v)"
  259. TextLabel9.Position = UDim2.new(0, 5, 0, 75)
  260. TextLabel9.BackgroundColor3 = Color3.new(1, 1, 1)
  261. TextLabel9.BackgroundTransparency = 1
  262. TextLabel9.Font = Enum.Font.SourceSansBold
  263. TextLabel9.TextSize = 20
  264. TextLabel9.TextColor3 = Color3.new(1, 1, 1)
  265. TextLabel9.TextStrokeColor3 = Color3.new(1, 1, 1)
  266. TextLabel9.TextXAlignment = Enum.TextXAlignment.Left
  267. TextLabel10.Parent = Frame1
  268. TextLabel10.Size = UDim2.new(0, 95, 0, 25)
  269. TextLabel10.Text = "Color (r)"
  270. TextLabel10.Position = UDim2.new(0, 5, 0, 100)
  271. TextLabel10.BackgroundColor3 = Color3.new(1, 1, 1)
  272. TextLabel10.BackgroundTransparency = 1
  273. TextLabel10.Font = Enum.Font.SourceSansBold
  274. TextLabel10.TextSize = 20
  275. TextLabel10.TextColor3 = Color3.new(1, 1, 1)
  276. TextLabel10.TextStrokeColor3 = Color3.new(1, 1, 1)
  277. TextLabel10.TextXAlignment = Enum.TextXAlignment.Left
  278. Frame11.Name = "Color"
  279. Frame11.Parent = Frame1
  280. Frame11.Transparency = 0.80000001192093
  281. Frame11.Size = UDim2.new(0, 121, 0, 115)
  282. Frame11.Position = UDim2.new(0, 201, 0, 15)
  283. Frame11.BackgroundColor3 = Color3.new(0.0470588, 0.0509804, 0.0588235)
  284. Frame11.BackgroundTransparency = 0.80000001192093
  285. Frame11.BorderColor3 = Color3.new(1, 1, 1)
  286. Frame11.BorderSizePixel = 0
  287. Frame11.Draggable = true
  288. Frame12.Parent = Frame11
  289. Frame12.Size = UDim2.new(0, 3, 1, 0)
  290. Frame12.Position = UDim2.new(1, 0, 0, 0)
  291. Frame12.BackgroundColor3 = Color3.new(1, 1, 1)
  292. Frame12.BorderSizePixel = 0
  293. Frame13.Parent = Frame11
  294. Frame13.Size = UDim2.new(1, 0, 0, 3)
  295. Frame13.Position = UDim2.new(0, 0, 0, -3)
  296. Frame13.BackgroundColor3 = Color3.new(1, 1, 1)
  297. Frame13.BorderSizePixel = 0
  298. Frame14.Parent = Frame11
  299. Frame14.Size = UDim2.new(1, 0, 0, 3)
  300. Frame14.Position = UDim2.new(0, 0, 1, 0)
  301. Frame14.BackgroundColor3 = Color3.new(1, 1, 1)
  302. Frame14.BorderSizePixel = 0
  303. Frame15.Parent = Frame11
  304. Frame15.Size = UDim2.new(0, 3, 1, 0)
  305. Frame15.Position = UDim2.new(0, -3, 0, 0)
  306. Frame15.BackgroundColor3 = Color3.new(1, 1, 1)
  307. Frame15.BorderSizePixel = 0
  308. Frame16.Name = "Picker"
  309. Frame16.Parent = Frame11
  310. Frame16.Transparency = 1
  311. Frame16.Size = UDim2.new(0, 286, 0, 255)
  312. Frame16.Position = UDim2.new(0, -372, 0, -55)
  313. Frame16.BackgroundColor3 = Color3.new(0.498039, 0.247059, 0.247059)
  314. Frame16.BackgroundTransparency = 1
  315. Frame16.BorderColor3 = Color3.new(0, 0, 0)
  316. ImageButton17.Name = "SV"
  317. ImageButton17.Parent = Frame16
  318. ImageButton17.Size = UDim2.new(0, 101, 0, 105)
  319. ImageButton17.Position = UDim2.new(0, 377, 0, 60)
  320. ImageButton17.BackgroundColor3 = Color3.new(1, 0, 0)
  321. ImageButton17.BorderColor3 = Color3.new(0, 0, 0)
  322. ImageButton17.BorderSizePixel = 0
  323. ImageButton17.AutoButtonColor = false
  324. ImageButton17.Image = "http://www.roblox.com/asset/?id=42462986"
  325. TextLabel18.Name = "Locator"
  326. TextLabel18.Parent = ImageButton17
  327. TextLabel18.Text = "o"
  328. TextLabel18.Position = UDim2.new(0.5, 0, 0.5, 0)
  329. TextLabel18.BorderColor3 = Color3.new(0, 0, 0)
  330. TextLabel18.FontSize = Enum.FontSize.Size12
  331. TextLabel18.TextColor3 = Color3.new(1, 1, 1)
  332. ImageButton19.Name = "H"
  333. ImageButton19.Parent = Frame16
  334. ImageButton19.Size = UDim2.new(0, 10, 0, 105)
  335. ImageButton19.Position = UDim2.new(0, 477, 0, 60)
  336. ImageButton19.BorderColor3 = Color3.new(0, 0, 0)
  337. ImageButton19.BorderSizePixel = 0
  338. ImageButton19.AutoButtonColor = false
  339. ImageButton19.Image = "http://www.roblox.com/asset/?id=42463044"
  340. LocalScript20.Parent = Frame16
  341. Color3Value21.Name = "Col"
  342. Color3Value21.Parent = Frame11
  343. TextLabel22.Name = "ColorT"
  344. TextLabel22.Parent = Frame1
  345. TextLabel22.Size = UDim2.new(0, 65, 0, 25)
  346. TextLabel22.Text = "0, 0, 0"
  347. TextLabel22.Position = UDim2.new(0, 126, 0, 100)
  348. TextLabel22.BackgroundColor3 = Color3.new(1, 1, 1)
  349. TextLabel22.BackgroundTransparency = 1
  350. TextLabel22.Font = Enum.Font.SourceSansBold
  351. TextLabel22.TextSize = 20
  352. TextLabel22.TextColor3 = Color3.new(1, 1, 1)
  353. TextLabel22.TextScaled = true
  354. TextLabel22.TextStrokeColor3 = Color3.new(1, 1, 1)
  355. TextLabel22.TextWrapped = true
  356. TextLabel23.Name = "Transparent"
  357. TextLabel23.Parent = Frame1
  358. TextLabel23.Size = UDim2.new(0, 25, 0, 25)
  359. TextLabel23.Text = "0"
  360. TextLabel23.Position = UDim2.new(0, 146, 0, 75)
  361. TextLabel23.BackgroundColor3 = Color3.new(1, 1, 1)
  362. TextLabel23.BackgroundTransparency = 1
  363. TextLabel23.Font = Enum.Font.SourceSansBold
  364. TextLabel23.TextSize = 20
  365. TextLabel23.TextColor3 = Color3.new(1, 1, 1)
  366. TextLabel23.TextStrokeColor3 = Color3.new(1, 1, 1)
  367. TextLabel23.TextWrapped = true
  368. TextLabel24.Name = "CanCollide"
  369. TextLabel24.Parent = Frame1
  370. TextLabel24.Size = UDim2.new(0, 55, 0, 25)
  371. TextLabel24.Text = "false"
  372. TextLabel24.Position = UDim2.new(0, 131, 0, 50)
  373. TextLabel24.BackgroundColor3 = Color3.new(1, 1, 1)
  374. TextLabel24.BackgroundTransparency = 1
  375. TextLabel24.Font = Enum.Font.SourceSansBold
  376. TextLabel24.TextSize = 20
  377. TextLabel24.TextColor3 = Color3.new(1, 1, 1)
  378. TextLabel24.TextStrokeColor3 = Color3.new(1, 1, 1)
  379. TextLabel24.TextWrapped = true
  380. TextLabel25.Name = "Thickness"
  381. TextLabel25.Parent = Frame1
  382. TextLabel25.Size = UDim2.new(0, 25, 0, 25)
  383. TextLabel25.Text = "1"
  384. TextLabel25.Position = UDim2.new(0, 146, 0, 25)
  385. TextLabel25.BackgroundColor3 = Color3.new(1, 1, 1)
  386. TextLabel25.BackgroundTransparency = 1
  387. TextLabel25.Font = Enum.Font.SourceSansBold
  388. TextLabel25.TextSize = 20
  389. TextLabel25.TextColor3 = Color3.new(1, 1, 1)
  390. TextLabel25.TextStrokeColor3 = Color3.new(1, 1, 1)
  391. TextLabel25.TextWrapped = true
  392.  
  393. presets = GUI.Settings
  394. colors = presets.Color
  395.  
  396. function round(num, numDecimalPlaces)
  397. local mult = 10^(numDecimalPlaces or 0)
  398. return tostring(math.floor(num * mult + 0.5) / mult)
  399. end
  400.  
  401. spawn(function()
  402. local frame = colors.Picker
  403. local sv = frame.SV
  404. local h = frame.H
  405. local locator = sv.Locator
  406.  
  407. local hue = 0
  408. local saturation = 0.5
  409. local value = 0.5
  410.  
  411. local changingHue = false
  412. local changingSv = false
  413.  
  414. function getRGBfromHue()
  415. local r,g,b = 0,0,0
  416. if hue>=120 and hue<=240 then r = 0
  417. elseif hue>=300 or hue<=60 then r = 1
  418. elseif hue>60 and hue<120 then r = 1-(hue-60)/60
  419. elseif hue>240 and hue<300 then r = (hue-240)/60
  420. end
  421.  
  422. if hue>=240 and hue<=360 then g = 0
  423. elseif hue>=60 and hue<=180 then g = 1
  424. elseif hue>180 and hue<240 then g = 1-(hue-180)/60
  425. elseif hue<60 then g = hue/60
  426. end
  427.  
  428. if hue<=120 then b = 0
  429. elseif hue>=180 and hue<=300 then b = 1
  430. elseif hue>120 and hue<180 then b = (hue-120)/60
  431. elseif hue>300 and hue<360 then b = 1-(hue-300)/60
  432. end
  433. return r,g,b
  434. end
  435.  
  436. function changeHue(x,y)
  437. if not changingHue then return end
  438. hue = 360*(1-(y-h.AbsolutePosition.y)/h.AbsoluteSize.y)+85
  439.  
  440. local r,g,b = getRGBfromHue()
  441.  
  442. sv.BackgroundColor3 = Color3.new(r,g,b)
  443. toRGB()
  444. end
  445.  
  446. function changeSv(x,y)
  447. if not changingSv then return end
  448. local x,y = x-sv.AbsolutePosition.x,y-sv.AbsolutePosition.y-35
  449. locator.Position = UDim2.new(0,x,0,y)
  450. if y>=(sv.AbsoluteSize.y)/2 then locator.TextColor3 = Color3.new(1,1,1) else locator.TextColor3 = Color3.new(0,0,0) end
  451. saturation,value = 1-(x/sv.AbsoluteSize.x), 1-(y/sv.AbsoluteSize.y)
  452. toRGB()
  453. end
  454.  
  455. function toRGB()
  456. local r,g,b = getRGBfromHue()
  457.  
  458. local max = math.max(r,g,b)
  459. r,g,b = value*(r+saturation*(max-r)),value*(g+saturation*(max-g)),value*(b+saturation*(max-b))
  460.  
  461.  
  462. colors.Col.Value = Color3.new(r,g,b)
  463. end
  464.  
  465. h.MouseButton1Down:connect(function(x,y) changingHue = true changeHue(x,y) end)
  466. h.MouseButton1Up:connect(function() changingHue = false end)
  467. h.MouseMoved:connect(changeHue)
  468.  
  469. sv.MouseButton1Down:connect(function(x,y) changingSv = true changeSv(x,y) end)
  470. sv.MouseButton1Up:connect(function() changingSv = false end)
  471. sv.MouseMoved:connect(changeSv)
  472. end)
  473.  
  474. spawn(function()
  475. while wait() do
  476. if transparency < 0 then transparency = 0 end
  477. if transparency > 1 then transparency = 0 end
  478. color = colors.Col.Value
  479. local c = color
  480. if c.r < 0 then
  481. c = Color3.new(0,c.g,c.b)
  482. end
  483. if c.g < 0 then
  484. c = Color3.new(c.r,0,c.b)
  485. end
  486. if c.b < 0 then
  487. c = Color3.new(c.r,c.g,0)
  488. end
  489. if c.r > 1 then
  490. c = Color3.new(1,c.g,c.b)
  491. end
  492. if c.g > 1 then
  493. c = Color3.new(c.r,1,c.b)
  494. end
  495. if c.b > 1 then
  496. c = Color3.new(c.r,c.g,1)
  497. end
  498. color = c
  499. colors.Col.Value = c
  500. presets.ColorT.Text = round(color.r,1)..", "..round(color.g,1)..", "..round(color.b,1)
  501. presets.Transparent.Text = tostring(transparency)
  502. local th = tostring(thickness)
  503. if thickness < 0.15 then
  504. th = '0.1'
  505. end
  506. presets.Thickness.Text = tostring(th)
  507. presets.CanCollide.Text = tostring(canCollide)
  508. end
  509. end)
  510.  
  511. local UIS = game:GetService("UserInputService")
  512. UIS.InputEnded:connect(function(k,g)
  513. if k.KeyCode == Enum.KeyCode.Equals and not g then
  514. enabled = not enabled
  515. end
  516. end)
  517.  
  518. drawings = Instance.new("Model",workspace)
  519. drawings.Name = "Drawings"
  520.  
  521. lastd = nil
  522.  
  523. spawn(function()
  524. while wait() do
  525. mouse = plr:GetMouse()
  526. if drawings == nil then
  527. drawings = Instance.new("Model",workspace)
  528. drawings.Name = "Drawings"
  529. end
  530. if drawings.Parent ~= workspace then
  531. drawings.Parent = workspace
  532. end
  533. end
  534. end)
  535.  
  536. canCollide = false
  537. canStack = false
  538. thickness = 1
  539. color = Color3.new(1,0,0)
  540. transparency = 0
  541. interval = 0.1
  542. rainbow = false
  543.  
  544.  
  545. lastm = nil
  546.  
  547. drawing = false
  548.  
  549. neon = false
  550.  
  551.  
  552. local zDown = false
  553.  
  554. mdown = false
  555. ndown = false
  556. bdown = false
  557. vdown = false
  558.  
  559. spawn(function()
  560. while wait() do
  561. if ndown == true then
  562. if not (thickness < 0.2) then
  563. thickness = thickness - 0.2
  564. end
  565. end
  566. if mdown == true then
  567. if (thickness < 20) then
  568. thickness = thickness + 0.2
  569. end
  570. end
  571. if bdown == true then
  572. if (transparency < 0.9) then
  573. transparency = transparency + 0.1
  574. wait(0.1)
  575. end
  576. end
  577. if vdown == true then
  578. if (transparency > 0) then
  579. transparency = transparency - 0.1
  580. end
  581. if string.sub(tostring(transparency),1,3) == "2.7" then transparency = 0 end
  582. wait(0.1)
  583. end
  584. end
  585. end)
  586. killer = false
  587. mouse.KeyDown:connect(function(k)
  588. if enabled == false then return end
  589. local key = k:lower()
  590. if key == "m" then
  591. mdown = true
  592. end
  593. if key == "q" then
  594. killer = not killer
  595. end
  596. if key == "n" then
  597. ndown = true
  598. end
  599. if key == "x" then
  600. neon = not neon
  601. end
  602. if key == "b" then
  603. bdown = true
  604. end
  605. if key == "v" then
  606. vdown = true
  607. end
  608. if key == "z" then
  609. zDown = true
  610. local draw = drawings[#drawings:GetChildren()]
  611. if not draw then return end
  612. draw:Destroy()
  613. end
  614. if key == "f" then
  615. drawings:ClearAllChildren()
  616. end
  617. if key == "r" then
  618. rainbow = not rainbow
  619. end
  620. if key == "c" then
  621. canCollide = not canCollide
  622. end
  623. end)
  624.  
  625. mouse.KeyUp:connect(function(k)
  626. local key = k:lower()
  627. if key == "m" then
  628. mdown = false
  629. end
  630. if key == "n" then
  631. ndown = false
  632. end
  633. if key == "b" then
  634. bdown = false
  635. end
  636. if key == "v" then
  637. vdown = false
  638. end
  639. if key == "z" then
  640. zDown = false
  641. end
  642. end)
  643.  
  644. local uis = game:GetService("UserInputService")
  645. uis.InputBegan:connect(function(k,g)
  646. if g then return end
  647. if k.UserInputType == Enum.UserInputType.MouseButton1 then
  648. drawing = true
  649. end
  650. end)
  651. uis.InputEnded:connect(function(k,g)
  652. if k.UserInputType == Enum.UserInputType.MouseButton1 then
  653. drawing = false
  654. end
  655. end)
  656.  
  657. spawn(function()
  658. while wait() do
  659. if zDown == true then
  660. local zWasUp = false
  661. local n = 0
  662. repeat wait() if zDown == false then zWasUp = true end n = n + 0.5 until n >= 10
  663. if zDown == true and zWasUp == false then
  664. repeat
  665. game:GetService("RunService").RenderStepped:Wait()
  666. pcall(function()
  667. local draw = drawings[#drawings:GetChildren()]
  668. draw:Destroy()
  669. end)
  670. until zDown == false
  671. end
  672. end
  673. end
  674. end)
  675.  
  676. mouse.TargetFilter = drawings
  677. ldraw = nil
  678. game:GetService("RunService").RenderStepped:connect(function()
  679. if drawing == false then
  680. lastm = mouse.Hit.p
  681. ldraw = nil
  682. end
  683. print(drawing)
  684. if drawing == true and (lastm ~= mouse.Hit.p) and enabled then
  685. local mp = mouse.Hit.p
  686. local mh = mouse.Hit
  687. local mt = mouse.Target
  688. if not ldraw then lastm = mp end
  689. if true then
  690. if (mp - lastm).magnitude < thickness*1.5 and ldraw then return end
  691. local draw = Instance.new("Part",drawings)
  692. draw.Name = #drawings:GetChildren()
  693. draw.Anchored = true
  694. draw.CanCollide = canCollide
  695. if neon then
  696. draw.Material = "Neon"
  697. else
  698. draw.Material = "SmoothPlastic"
  699. end
  700. draw.Transparency = transparency
  701. draw.CFrame = CFrame.new((lastm + mouse.Hit.p)/2,lastm)
  702.  
  703. draw.Size = Vector3.new(0,0,(lastm - mp).magnitude)
  704. tween(draw, "Sine", "Out", 0.1, {
  705. Size = Vector3.new(thickness,thickness,(lastm - mp).magnitude)
  706. })
  707. local orr = draw.Size
  708.  
  709. if killer then
  710. coroutine.resume(coroutine.create(function()
  711. local oz = Vector3.new(thickness,thickness,(lastm - mp).magnitude)
  712. while draw and draw.Parent == drawings do
  713. local t = tween(draw, "Sine", "InOut", 0.5, {
  714. Size = oz * 1.2 + Vector3.new(0.25,0.25,0)
  715. })
  716. t.Completed:Wait(0)
  717. local t = tween(draw, "Sine", "InOut", 0.5, {
  718. Size = oz
  719. })
  720. t.Completed:Wait(0)
  721. end
  722. end))
  723. end
  724.  
  725. if rainbow == false then
  726. draw.Color = color
  727. else
  728. local start = 0
  729. spawn(function()
  730. local rs = 1
  731. while game:GetService("RunService").RenderStepped:Wait() do
  732. game:GetService("RunService").RenderStepped:Wait()
  733. game:GetService("RunService").RenderStepped:Wait()
  734. if draw == nil or draw.Parent == nil then break end
  735. rs = rs + 0.2
  736. local r = (math.sin(start/2)/2)+0.5
  737. local g = (math.sin(start)/2)+0.5
  738. local b = (math.sin(start*1.5)/2)+0.5
  739. local color3 = Color3.new(r, g, b)
  740. draw.Color = color3
  741. start = start + interval + math.abs(math.sin(rs))/10
  742. end
  743. end)
  744. end
  745. ldraw = draw
  746. end
  747. end
  748. lastm = mouse.Hit.p
  749. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement