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