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