View difference between Paste ID: iLYkK30w and rya9PwUp
SHOW: | | - or go back to the newest paste.
1
2
3
--[[
4
Tf2 Engineer Class	
5
--------------------
6
Script by: 123jl123
7
---------------------	
8
Sentry by: Madiik
9
-- ]]
10
 
11
12
local plr = game:service'Players'.LocalPlayer
13
local char = plr.Character
14
local mouse = plr:GetMouse()
15
local humanoid = char:findFirstChild("Humanoid")
16
local torso = char:findFirstChild("Torso")
17
local head = char.Head
18
local ra = char:findFirstChild("Right Arm")
19
local la = char:findFirstChild("Left Arm")
20
local rl = char:findFirstChild("Right Leg")
21
local ll = char:findFirstChild("Left Leg")
22
local rs = torso:findFirstChild("Right Shoulder")
23
local ls = torso:findFirstChild("Left Shoulder")
24
local rh = torso:findFirstChild("Right Hip")
25
local lh = torso:findFirstChild("Left Hip")
26
local neck = torso:findFirstChild("Neck")
27
local rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
28
local rootpart = char:findFirstChild("HumanoidRootPart")
29
local camera = workspace.CurrentCamera
30
local anim = char:findFirstChild("Animate")
31
DA = false
32
NoSentry = true
33
maincolor = game.Players.LocalPlayer.Character.Torso.BrickColor.Name
34
secondcolor = "Really black"
35
WSHM = {'10209908','10209905','10209905','10209908'}
36
WSH = WSHM[math.random(1,#WSHM)]	
37
wait(1 / 60)
38
Effects = { }
39
local Player = game.Players.localPlayer
40
local Character = Player.Character
41
local Humanoid = Character.Humanoid
42
local mouse = Player:GetMouse()
43
local LeftArm = Character["Left Arm"]
44
local RightArm = Character["Right Arm"]
45
local LeftLeg = Character["Left Leg"]
46
local RightLeg = Character["Right Leg"]
47
local Head = Character.Head
48
local Torso = Character.Torso
49
local cam = game.Workspace.CurrentCamera
50
local RootPart = Character.HumanoidRootPart
51
local RootJoint = RootPart.RootJoint
52
local equipped = false
53
local attack = false
54
local Anim = 'Idle'
55
local idle = 0
56
local attacktype = 1
57
local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude 
58
local velocity = RootPart.Velocity.y
59
local sine = 0
60
local change = 1
61
local grabbed = false
62
local cn = CFrame.new
63
local mr = math.rad
64
local angles = CFrame.Angles
65
local ud = UDim2.new
66
local c3 = Color3.new
67
local slashDamage = 15
68
trans = 1
69
for i,v in pairs(char:GetChildren()) do if v:IsA("Accessory") then v:Remove() end end
70
for i,v in pairs(char:GetChildren()) do if v:IsA("Hat") then v:Remove() end end
71
Wep = 1
72
equippedgun2 = false
73
74
75
76
77
78
79
80
81
82
83
--SB Plasma Shotgun 2013
84
85
--madiik's plasma shottie
86
87
--variables
88
89
90
91
--some more variables
92
93
local spread = 1
94
-- end of some more variables
95
96
local sound = Instance.new("Sound",head)
97
sound.SoundId = "http://www.roblox.com/asset?id=10209842"
98
sound.Volume = 2
99
sound.Pitch = 1
100
101
	
102
103
104
105
106
107
local sound2 = Instance.new("Sound",head)
108
sound2.SoundId = "http://www.roblox.com/asset?id=10209881"
109
sound2.Volume = 1
110
sound2.Pitch = 1
111
112
113
114
115
116
117
118
function attach(weld, part0, part1)
119
weld.Part0 = part0
120
weld.Part1 = part1
121
end
122
123
124
125
126
127
128
129
130
131
--create func
132
function part(parent, size, color, formfactor, collide, transparency)
133
if transparency == nil then transparency = 0 end
134
if collide == nil then collide = false end
135
if formfactor == nil then formfactor = Enum.FormFactor.Custom end
136
local p=Instance.new("Part", parent)
137
p.FormFactor=formfactor
138
p.CanCollide=false
139
p.Size=size
140
p.Locked=true
141
p.Transparency=transparency
142
p.Position=torso.Position
143
p.BrickColor=color
144
p.FrontSurface="SmoothNoOutlines" 
145
p.BackSurface="SmoothNoOutlines" 
146
p.LeftSurface="SmoothNoOutlines" 
147
p.BottomSurface="SmoothNoOutlines" 
148
p.TopSurface="SmoothNoOutlines" 
149
p.RightSurface="SmoothNoOutlines" 
150
return p
151
end
152
function wedge(parent, size, color, formfactor, collide, transparency)
153
154
if transparency == nil then transparency = 0 end
155
if collide == nil then collide = false end
156
if formfactor == nil then formfactor = Enum.FormFactor.Custom end
157
158
local p=Instance.new("WedgePart", parent)
159
p.FormFactor=formfactor
160
p.CanCollide=false
161
p.Size=size
162
p.Locked=true
163
p.Position = torso.Position
164
p.BrickColor=color
165
p.FrontSurface="SmoothNoOutlines" 
166
p.BackSurface="SmoothNoOutlines" 
167
p.LeftSurface="SmoothNoOutlines" 
168
p.BottomSurface="SmoothNoOutlines" 
169
p.TopSurface="SmoothNoOutlines" 
170
p.RightSurface="SmoothNoOutlines"
171
return p
172
end 
173
function weld(part0, part1, c0, parent, c1)
174
if parent == nil then parent = gun end
175
if c1 == nil then c1 = CFrame.new() end
176
177
local wel=Instance.new("Weld", parent)
178
wel.Part0 = part0
179
wel.Part1 = part1
180
wel.C0 = c0
181
wel.C1 = c1
182
return wel
183
end
184
function specialmesh(parent, meshType, scale, meshId)
185
local mesh = Instance.new("SpecialMesh", parent)
186
mesh.Scale = scale
187
mesh.MeshType = meshType
188
mesh.MeshId = meshId
189
return mesh
190
end
191
192
193
--some ray functi0n
194
195
function rayCast2(speed, gravity, from)
196
coroutine.wrap(function()        
197
if char.Humanoid.Health == 0 then return end
198
local rayP = Instance.new("Part")
199
rayP.Name = "rayP"
200
rayP.BrickColor = BrickColor.new("New Yeller")
201
rayP.Material = 'Neon'
202
rayP.Anchored = true
203
rayP.CanCollide = false
204
rayP.Locked = true
205
rayP.TopSurface = Enum.SurfaceType.Smooth
206
rayP.BottomSurface = Enum.SurfaceType.Smooth
207
rayP.formFactor = Enum.FormFactor.Custom
208
rayP.Size = Vector3.new(0.2, 0.2, 0.2)
209
210
211
212
Instance.new("BlockMesh", rayP).Scale = Vector3.new(0.2, 0.2, 10)
213
214
215
216
217
218
219
220
221
local bulletposition = from.Position + Vector3.new(0, 0.3, 0)
222
223
local bulletvelocity = (Vector3.new(math.random(-spread*4,spread*4), math.random(-spread*4,spread*4), math.random(-spread*4,spread*4)))+( plr:GetMouse().Hit.p - bulletposition).unit*speed
224
local bulletlastposition = bulletposition
225
226
227
228
229
coroutine.resume(coroutine.create(function()
230
while true do
231
local dt = wait()
232
bulletlastposition = bulletposition
233
bulletvelocity = bulletvelocity + (Vector3.new(0, -14.81*gravity, 0)*dt)
234
bulletposition = bulletposition + (bulletvelocity*dt)
235
236
local ray = Ray.new(bulletlastposition, (bulletposition - bulletlastposition))
237
238
local hit, hitposition = workspace:FindPartOnRayWithIgnoreList( ray, { char, rayP, TrailPart} )
239
240
if (torso.Position - rayP.Position).magnitude > 540 then
241
rayP:Destroy()
242
break
243
end
244
245
246
if hit then
247
local damage = math.random(10, 20)
248
if hit.Parent:findFirstChild("Humanoid") ~= nil then
249
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage
250
end
251
if hit.Parent:IsA("Hat") and hit.Parent.Parent:findFirstChild("Humanoid") ~= nil then
252
hit.Parent.Parent.Humanoid.Health = hit.Parent.Parent.Humanoid.Health - damage        
253
end
254
bulletposition = hitposition
255
rayP.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity)
256
rayP:Destroy()
257
break
258
end
259
rayP.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity)
260
rayP.Parent = workspace
261
end
262
end))
263
end)()
264
end
265
266
267
268
269
270
271
272
--function attach(weld, part0, part1)
273
--weld.Part0 = part0
274
--weld.Part1 = part1
275
--end
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
TmRed = false
304
TmBlue = false
305
TeamColor = BrickColor.new("Really Black")
306
307
	local BC = char["Body Colors"]
308
	BC.HeadColor = BrickColor.new("Pastel brown")
309
	BC.LeftArmColor = BrickColor.new("Pastel brown")
310
	BC.LeftLegColor = BrickColor.new("Pastel brown")
311
	BC.RightArmColor = BrickColor.new("Pastel brown")
312
	BC.RightLegColor = BrickColor.new("Pastel brown")
313
	BC.TorsoColor = BrickColor.new("Pastel brown")
314
	
315
	
316
New = function(Object, Parent, Name, Data)
317
	local Object = Instance.new(Object)
318
	for Index, Value in pairs(Data or {}) do
319
		Object[Index] = Value
320
	end
321
	Object.Parent = Parent
322
	Object.Name = Name
323
	return Object
324
end
325
local AddInstance = function(Object, ...)
326
local Obj = Instance.new(Object)
327
for i,v in next,(...) do
328
Obj[i] = v
329
end
330
return Obj
331
end	
332
	
333
334
335
336
337
Team=function()
338
339-
local r=math.random(1,2)
339+
340-
if r==1 then
340+
341-
print('RED')	
341+
print('Enjoi')
342-
script.Name = "TeamRed"
342+
343-
TmRed = true
343+
344
for i,v in pairs(char:GetChildren()) do if v:IsA("Shirt") then v:Remove() end end
345
for i,v in pairs(char:GetChildren()) do if v:IsA("Pants") then v:Remove() end end
346
wait()shirt = Instance.new("Shirt", char)
347
shirt.Name = "Shirt"
348
pants = Instance.new("Pants", char)
349
pants.Name = "Pants"
350-
char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=69232230"
350+
351-
char.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=69232580" 
351+
352-
TeamColor = BrickColor.new("Bright red")
352+
TeamColor = BrickColor.new("Navy Blue")
353
end
354
print(''..r)
355-
if r==2 then
355+
356-
print('BLUE')
356+
357
Team()
358
359
360
	
361
362
			
363
			
364
			
365
			
366
			
367-
TeamColor = BrickColor.new("Bright blue")
367+
368
			
369
local Reaper4 = AddInstance("Part",{
370
			Parent = RightArm,		
371
			CFrame = RightArm.CFrame,
372
			formFactor = "Symmetric",
373
			Size = Vector3.new(0.1, 0.5, 3),
374
			CanCollide = false,
375
			TopSurface = "Smooth",
376-
local MusThingHat = AddInstance("Part",{
376+
377-
			Parent = head,
377+
378-
			CFrame = head.CFrame,
378+
379
		})
380-
			Size = Vector3.new(1, 1, 1),
380+
381
			Parent = Reaper4,
382
			Part0 = RightArm,
383
			C0 = CFrame.new(-0.35,-1.8,-0.4)*CFrame.Angles(4.7,3.4,0),
384
			Part1 = Reaper4,
385
		})
386-
			Transparency = 1,
386+
387
			Parent = Reaper4,
388
			MeshId = "rbxassetid://470533002",
389-
			Parent = MusThingHat,
389+
390-
			Part0 = head,
390+
391-
			C0 = CFrame.new(0,0.5,0)*CFrame.Angles(0,0,0),
391+
392-
			Part1 = MusThingHat,
392+
393
			
394
	local GunFire = AddInstance("Part",{
395-
			Parent = MusThingHat,
395+
396
			CFrame = RightArm.CFrame,
397-
			Scale = Vector3.new(.1,0,.1),
397+
398
			Size = Vector3.new(0.1, 0.1, 0.1),
399
			CanCollide = false,
400
			TopSurface = "Smooth",
401-
local Reaper = AddInstance("Part",{
401+
402-
			Parent = head,
402+
403-
			CFrame = head.CFrame,
403+
404
		})
405-
			Size = Vector3.new(1, 1, 1),
405+
406
			Parent = GunFire,
407
			Part0 = RightArm,
408
			C0 = CFrame.new(-0.8,-3.5,-0.7)*CFrame.Angles(4.7,3.4,0),
409
			Part1 = GunFire,
410
		})
411
		
412
			
413-
			Parent = Reaper,
413+
414-
			Part0 = head,
414+
415-
			C0 = CFrame.new(-.04,.7,-.1)*CFrame.Angles(0,0,.08),
415+
416-
			Part1 = Reaper,
416+
417
        local Colors2 = {Color3.new(1,.5,0), Color3.new(1,.7,0), Color3.new(1,.9,0);}		
418
		        GunParticle.Size = NumberSequence.new(.05,.07);
419-
			Parent = Reaper,
419+
420-
			MeshId = "rbxassetid://1073659",
420+
421-
			Scale = Vector3.new(1.06,1.05,1.06),
421+
422
        GunParticle.RotSpeed = NumberRange.new(10,70);
423
        GunParticle.Rate = 600;
424
        GunParticle.Speed = NumberRange.new(15);
425-
local Helmpart2 = AddInstance("Part",{
425+
426-
			Parent = head,
426+
427-
			CFrame = head.CFrame,
427+
428
GunParticle.Enabled = false	
429-
			Size = Vector3.new(1, 1, 1),
429+
430
			
431
			
432
			
433
			
434-
			BrickColor=BrickColor.new("White"),
434+
435
			
436
			
437-
			Parent = Helmpart2,
437+
438-
			Part0 = head,
438+
439-
			C0 = CFrame.new(.01,.4,.05)*CFrame.Angles(.1,0,-.02),
439+
440-
			Part1 = Helmpart2,
440+
441
			Size = Vector3.new(0.1, 0.5, 3),
442
			CanCollide = false,
443-
			Parent = Helmpart2,
443+
444-
			Scale = Vector3.new(1.28,.48,1.28),
444+
445
			Locked = true,
446
			Transparency = 1
447
		})
448
		local Weld = AddInstance("Weld",{
449-
local Glassespart2 = AddInstance("Part",{
449+
450-
			Parent = head,
450+
451-
			CFrame = head.CFrame,
451+
452
			Part1 = Reaper5,
453-
			Size = Vector3.new(1, 1, 1),
453+
454
		local Mesh = AddInstance("SpecialMesh",{
455
			Parent = Reaper5,
456
			MeshId = "rbxassetid://431003868",
457
			TextureId = "rbxassetid://430627740",
458-
			BrickColor=BrickColor.new("Really black"),
458+
459
			VertexColor = Vector3.new(1,1,1),
460
		})	
461-
			Parent = Glassespart2,
461+
462-
			Part0 = head,
462+
463-
			C0 = CFrame.new(0,.35,0)*CFrame.Angles(0,0,0),
463+
464-
			Part1 = Glassespart2,
464+
465
			Parent = cam,	
466
			Name = "Arms",	
467-
			Parent = Glassespart2,
467+
468-
			Scale = Vector3.new(1.27,.5,1.27),
468+
469
		})
470
471
local Arm1 = AddInstance("Part",{
472
			Parent = Arms,	
473
			Name = "RightArm",	
474
			CFrame = RightArm.CFrame,
475
			formFactor = "Symmetric",
476
			Size = Vector3.new(.85,1.85,.85),
477
			CanCollide = false,
478
			Material = "SmoothPlastic",
479-
local Reaper3 = AddInstance("Part",{
479+
480-
			Parent = head,
480+
481-
			CFrame = head.CFrame,
481+
482
			BrickColor=BrickColor.new("Pastel brown"),
483-
			Size = Vector3.new(1, 1, 1),
483+
484
		})
485
		local Weld = AddInstance("Weld",{
486
			Parent = Arm1,
487
			Part0 = RightArm,
488-
			BrickColor=BrickColor.new("Gold"),
488+
489
			Part1 = Arm1,
490
		})
491-
			Parent = Reaper3,
491+
492-
			Part0 = head,
492+
493-
			C0 = CFrame.new(0,.3,-0.02)*CFrame.Angles(-.1,0,0),
493+
494-
			Part1 = Reaper3,
494+
495
			CFrame = LeftArm.CFrame,
496
			formFactor = "Symmetric",
497-
			Parent = Reaper3,
497+
498-
			MeshId = "rbxassetid://19380122",
498+
499-
			TextureId = "rbxassetid://19380117",
499+
500-
			Scale = Vector3.new(.9,1,1),
500+
501
			BottomSurface = "Smooth",
502
			Locked = true,
503
			BrickColor=BrickColor.new("Pastel brown"),
504
			Transparency = 0
505
		})
506
		local Weld = AddInstance("Weld",{
507
			Parent = Arm2,
508
			Part0 = LeftArm,
509
			C0 = CFrame.new(0,0,0)*CFrame.Angles(0,0,0),
510
			Part1 = Arm2,
511
		})
512
		
513
		
514
		
515
		
516
		local Arm3 = AddInstance("Part",{
517
			Parent = Arms,	
518
			Name = "RightArm",	
519
			CFrame = RightArm.CFrame,
520
			formFactor = "Symmetric",
521
			Size = Vector3.new(.9,.9,.9),
522
			CanCollide = false,
523
			Material = "SmoothPlastic",
524
			TopSurface = "Smooth",
525
			BottomSurface = "Smooth",
526
			Locked = true,
527
			BrickColor=TeamColor,
528
			Transparency = 0
529
		})
530
		local Weld = AddInstance("Weld",{
531
			Parent = Arm3,
532
			Part0 = RightArm,
533
			C0 = CFrame.new(0,.5,0)*CFrame.Angles(0,0,0),
534
			Part1 = Arm3,
535
		})
536
537
local Arm4 = AddInstance("Part",{
538
			Parent = Arms,	
539
			Name = "LeftArm",	
540
			CFrame = LeftArm.CFrame,
541
			formFactor = "Symmetric",
542
			Size = Vector3.new(.9,.9,.9),
543
			CanCollide = false,
544
			Material = "SmoothPlastic",
545
			TopSurface = "Smooth",
546
			BottomSurface = "Smooth",
547
			Locked = true,
548
			BrickColor=TeamColor,
549
			Transparency = 0
550
		})
551
		local Weld = AddInstance("Weld",{
552
			Parent = Arm4,
553
			Part0 = LeftArm,
554
			C0 = CFrame.new(0,.5,0)*CFrame.Angles(0,0,0),
555
			Part1 = Arm4,
556
		})
557
			local Arm5 = AddInstance("Part",{
558
			Parent = Arms,	
559
			Name = "RightArm",	
560
			CFrame = RightArm.CFrame,
561
			formFactor = "Symmetric",
562
			Size = Vector3.new(.86,.8,.86),
563
			CanCollide = false,
564
			Material = "SmoothPlastic",
565
			TopSurface = "Smooth",
566
			BottomSurface = "Smooth",
567
			Locked = true,
568
			BrickColor=BrickColor.new("Br. yellowish orange"),
569
			Transparency = 0
570
		})
571
		local Weld = AddInstance("Weld",{
572
			Parent = Arm5,
573
			Part0 = RightArm,
574
			C0 = CFrame.new(0,-.55,0)*CFrame.Angles(0,0,0),
575
			Part1 = Arm5,
576
		})
577
578
local Reaper6 = AddInstance("Part",{
579
			Parent = Arms,		
580
			CFrame = RightArm.CFrame,
581
			formFactor = "Symmetric",
582
			Size = Vector3.new(0.1, 0.1, .1),
583
			CanCollide = false,
584
			TopSurface = "Smooth",
585
			BottomSurface = "Smooth",
586
			Locked = true,
587
			Transparency = 1
588
		})
589
		local Weld = AddInstance("Weld",{
590
			Parent = Reaper6,
591
			Part0 = RightArm,
592
			C0 = CFrame.new(-0.35,-1.8,-0.4)*CFrame.Angles(4.7,3.4,0),
593
			Part1 = Reaper6,
594
		})
595
		local Mesh = AddInstance("SpecialMesh",{
596
			Parent = Reaper6,
597
			MeshId = "rbxassetid://470533002",
598
			TextureId = "rbxassetid://470533004",
599
			Scale = Vector3.new(.029,.029,.029),
600
			VertexColor = Vector3.new(1,1,1),
601
		})				
602
			
603
			
604
			
605
			
606
			
607
			
608
			
609
			
610
			
611
			
612
			
613
			
614
			
615
local Reaper7 = AddInstance("Part",{
616
			Parent = Arms,		
617
			CFrame = RightArm.CFrame,
618
			formFactor = "Symmetric",
619
			Size = Vector3.new(0.1, 0.5, 3),
620
			CanCollide = false,
621
			TopSurface = "Smooth",
622
			BottomSurface = "Smooth",
623
			Locked = true,
624
			Transparency = 1
625
		})
626
		local Weld = AddInstance("Weld",{
627
			Parent = Reaper7,
628
			Part0 = RightArm,
629
			C0 = CFrame.new(-.1,-0.75,-.7)*CFrame.Angles(1.5,0,3),
630
			Part1 = Reaper7,
631
		})
632
		local Mesh = AddInstance("SpecialMesh",{
633
			Parent = Reaper7,
634
			MeshId = "rbxassetid://431003868",
635
			TextureId = "rbxassetid://430627740",
636
			Scale = Vector3.new(1.9,1.98,1.98),
637
			VertexColor = Vector3.new(1,1,1),
638
		})	
639
640
641
head.face.Texture = "http://www.roblox.com/asset/?id=156600391"
642
local NeckCF = cn(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
643
Humanoid.Animator:Destroy()
644
Character.Animate:Destroy()
645
646
local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
647
local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
648
local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0)
649
650
651
RSH, LSH = nil, nil 
652
653
RW = Instance.new("Weld") 
654
LW = Instance.new("Weld")
655
656
RH = Torso["Right Hip"]
657
LH = Torso["Left Hip"]
658
659
RSH = Torso["Right Shoulder"] 
660
LSH = Torso["Left Shoulder"] 
661
662
RSH.Parent = nil 
663
LSH.Parent = nil 
664
665
RW.Name = "RW"
666
RW.Part0 = Torso 
667
RW.C0 = cn(1.5, 0.5, 0)
668
RW.C1 = cn(0, 0.5, 0) 
669
RW.Part1 = RightArm
670
RW.Parent = Torso 
671
672
LW.Name = "LW"
673
LW.Part0 = Torso 
674
LW.C0 = cn(-1.5, 0.5, 0)
675
LW.C1 = cn(0, 0.5, 0) 
676
LW.Part1 = LeftArm
677
LW.Parent = Torso 
678
679
function clerp(a, b, t) 
680
	local qa = {
681
		QuaternionFromCFrame(a)
682
	}
683
	local qb = {
684
		QuaternionFromCFrame(b)
685
	} 
686
	local ax, ay, az = a.x, a.y, a.z 
687
	local bx, by, bz = b.x, b.y, b.z
688
	local _t = 1 - t
689
	return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t)) 
690
end 
691
 
692
function QuaternionFromCFrame(cf) 
693
	local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() 
694
	local trace = m00 + m11 + m22 
695
	if trace > 0 then 
696
		local s = math.sqrt(1 + trace) 
697
		local recip = 0.5 / s 
698
		return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5 
699
	else 
700
		local i = 0 
701
		if m11 > m00 then
702
			i = 1
703
		end
704
		if m22 > (i == 0 and m00 or m11) then 
705
			i = 2 
706
		end 
707
		if i == 0 then 
708
			local s = math.sqrt(m00 - m11 - m22 + 1) 
709
			local recip = 0.5 / s 
710
			return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip 
711
		elseif i == 1 then 
712
			local s = math.sqrt(m11 - m22 - m00 + 1) 
713
			local recip = 0.5 / s 
714
			return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip 
715
		elseif i == 2 then 
716
			local s = math.sqrt(m22 - m00 - m11 + 1) 
717
			local recip = 0.5 / s
718
			return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip 
719
		end 
720
	end 
721
end
722
 
723
function QuaternionToCFrame(px, py, pz, x, y, z, w) 
724
	local xs, ys, zs = x + x, y + y, z + z 
725
	local wx, wy, wz = w * xs, w * ys, w * zs 
726
	local xx = x * xs 
727
	local xy = x * ys 
728
	local xz = x * zs 
729
	local yy = y * ys 
730
	local yz = y * zs 
731
	local zz = z * zs 
732
	return CFrame.new(px, py, pz, 1 - (yy + zz), xy - wz, xz + wy, xy + wz, 1 - (xx + zz), yz - wx, xz - wy, yz + wx, 1 - (xx + yy)) 
733
end
734
 
735
function QuaternionSlerp(a, b, t) 
736
	local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4] 
737
	local startInterp, finishInterp; 
738
	if cosTheta >= 0.0001 then 
739
		if (1 - cosTheta) > 0.0001 then 
740
			local theta = math.acos(cosTheta) 
741
			local invSinTheta = 1 / math.sin(theta) 
742
			startInterp = math.sin((1 - t) * theta) * invSinTheta 
743
			finishInterp = math.sin(t * theta) * invSinTheta  
744
		else 
745
			startInterp = 1 - t 
746
			finishInterp = t 
747
		end 
748
	else 
749
		if (1 + cosTheta) > 0.0001 then 
750
			local theta = math.acos(-cosTheta) 
751
			local invSinTheta = 1 / math.sin(theta) 
752
			startInterp = math.sin((t - 1) * theta) * invSinTheta 
753
			finishInterp = math.sin(t * theta) * invSinTheta 
754
		else 
755
			startInterp = t - 1 
756
			finishInterp = t 
757
		end 
758
	end 
759
	return a[1] * startInterp + b[1] * finishInterp, a[2] * startInterp + b[2] * finishInterp, a[3] * startInterp + b[3] * finishInterp, a[4] * startInterp + b[4] * finishInterp 
760
end
761
762
function swait(num)
763
	if num == 0 or num == nil then
764
		game:service'RunService'.RenderStepped:wait(0)
765
	else
766
		for i = 0, num do
767
			game:service'RunService'.RenderStepped:wait(0)
768
		end
769
	end
770
end
771
772
local RbxUtility = LoadLibrary("RbxUtility")
773
local Create = RbxUtility.Create
774
775
function RemoveOutlines(part)
776
	part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
777
end
778
	
779
function CreatePart(FormFactor, Parent, Material, Reflectance, Transparency, BColor, Name, Size)
780
	local Part = Create("Part"){
781
		formFactor = FormFactor,
782
		Parent = Parent,
783
		Reflectance = Reflectance,
784
		Transparency = Transparency,
785
		CanCollide = false,
786
		Locked = true,
787
		BrickColor = BrickColor.new(tostring(BColor)),
788
		Name = Name,
789
		Size = Size,
790
		Material = Material,
791
	}
792
	RemoveOutlines(Part)
793
	return Part
794
end
795
	
796
function CreateMesh(Mesh, Part, MeshType, MeshId, OffSet, Scale)
797
	local Msh = Create(Mesh){
798
		Parent = Part,
799
		Offset = OffSet,
800
		Scale = Scale,
801
	}
802
	if Mesh == "SpecialMesh" then
803
		Msh.MeshType = MeshType
804
		Msh.MeshId = MeshId
805
	end
806
	return Msh
807
end
808
	
809
function CreateWeld(Parent, Part0, Part1, C0, C1)
810
	local Weld = Create("Weld"){
811
		Parent = Parent,
812
		Part0 = Part0,
813
		Part1 = Part1,
814
		C0 = C0,
815
		C1 = C1,
816
	}
817
	return Weld
818
end
819
820
function rayCast(Position, Direction, Range, Ignore)
821
	return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore) 
822
end 
823
824
function CreateSound(id, par, vol, pit) 
825
	coroutine.resume(coroutine.create(function()
826
		local sou = Instance.new("Sound", par or workspace)
827
		sou.Volume = vol
828
		sou.Pitch = pit or 1
829
		sou.SoundId = id
830
		wait() 
831
		sou:play() 
832
		game:GetService("Debris"):AddItem(sou, 6)
833
	end))
834
end
835
836
local function getclosest(obj, distance)
837
	local last, lastx = distance + 1
838
	for i, v in pairs(workspace:GetChildren()) do
839
		if v:IsA'Model' and v ~= Character and v:findFirstChild('Humanoid') and v:findFirstChild('Torso') and v:findFirstChild('Humanoid').Health > 0 then
840
			local t = v.Torso
841
			local dist = (t.Position - obj.Position).magnitude
842
			if dist <= distance then
843
				if dist < last then
844
					last = dist
845
					lastx = v
846
				end
847
			end
848
		end
849
	end
850
	return lastx
851
end
852
853
function Damage(hit, damage, cooldown, Color1, Color2, HSound, HPitch)
854
	for i, v in pairs(hit:GetChildren()) do 
855
		if v:IsA("Humanoid") and hit.Name ~= Character.Name then
856
			local find = v:FindFirstChild("Hitz")
857
			if not find then
858
				if v.Parent:findFirstChild("Head") then
859
					local BillG = Create("BillboardGui"){
860
						Parent = v.Parent.Head,
861
						Size = UDim2.new(1, 0, 1, 0),
862
						Adornee = v.Parent.Head,
863
						StudsOffset = Vector3.new(math.random(-3, 3), math.random(3, 5), math.random(-3, 3)),
864
					}
865
					local TL = Create("TextLabel"){
866
						Parent = BillG,
867
						Size = UDim2.new(3, 3, 3, 3),
868
						BackgroundTransparency = 1,
869
						Text = tostring(damage).."-",
870
						TextColor3 = Color1.Color,
871
						TextStrokeColor3 = Color2.Color,
872
						TextStrokeTransparency = 0,
873
						TextXAlignment = Enum.TextXAlignment.Center,
874
						TextYAlignment = Enum.TextYAlignment.Center,
875
						FontSize = Enum.FontSize.Size18,
876
						Font = "ArialBold",
877
					}
878
					coroutine.resume(coroutine.create(function()
879
						wait(1)
880
						for i = 0, 1, .1 do
881
							wait(.1)
882
							BillG.StudsOffset = BillG.StudsOffset + Vector3.new(0, .1, 0)
883
						end
884
						BillG:Destroy()
885
					end))
886
				end
887
				v.Health = v.Health - damage
888
				local bool = Create("BoolValue"){
889
					Parent = v,
890
					Name = 'Hitz',
891
				}
892
				if HSound ~= nil and HPitch ~= nil then
893
					CreateSound(HSound, hit, 1, HPitch) 
894
				end
895
				game:GetService("Debris"):AddItem(bool, cooldown)
896
			end
897
		end
898
	end
899
end
900
901
902
function BlockEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, Type)
903
	local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
904
	prt.Anchored = true
905
	prt.CFrame = cframe
906
	local msh = CreateMesh("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
907
	game:GetService("Debris"):AddItem(prt, 10)
908
	if Type == 1 or Type == nil then
909
		table.insert(Effects, {
910
			prt,
911
			"Block1",
912
			delay,
913
			x3,
914
			y3,
915
			z3,
916
			msh
917
		})
918
	elseif Type == 2 then
919
		table.insert(Effects, {
920
			prt,
921
			"Block2",
922
			delay,
923
			x3,
924
			y3,
925
			z3,
926
			msh
927
		})
928
	end
929
end
930
931
function SphereEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
932
	local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
933
	prt.Anchored = true
934
	prt.CFrame = cframe
935
	local msh = CreateMesh("SpecialMesh", prt, "Sphere", "nil", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
936
	game:GetService("Debris"):AddItem(prt, 10)
937
	table.insert(Effects, {
938
		prt,
939
		"Cylinder",
940
		delay,
941
		x3,
942
		y3,
943
		z3,
944
		msh
945
	})
946
end
947
948
function RingEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
949
	local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5))
950
	prt.Anchored = true
951
	prt.CFrame = cframe * CFrame.new(x1, y1, z1)
952
	local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "3270017", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
953
	game:GetService("Debris"):AddItem(prt, 10)
954
	table.insert(Effects, {
955
		prt,
956
		"Cylinder",
957
		delay,
958
		x3,
959
		y3,
960
		z3,
961
		msh
962
	})
963
end
964
965
function CylinderEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
966
	local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
967
	prt.Anchored = true
968
	prt.CFrame = cframe
969
	local msh = CreateMesh("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
970
	game:GetService("Debris"):AddItem(prt, 10)
971
	table.insert(Effects, {
972
		prt,
973
		"Cylinder",
974
		delay,
975
		x3,
976
		y3,
977
		z3,
978
		msh
979
	})
980
end
981
982
function WaveEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
983
	local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
984
	prt.Anchored = true
985
	prt.CFrame = cframe
986
	local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "20329976", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
987
	game:GetService("Debris"):AddItem(prt, 10)
988
	table.insert(Effects, {
989
		prt,
990
		"Cylinder",
991
		delay,
992
		x3,
993
		y3,
994
		z3,
995
		msh
996
	})
997
end
998
999
function SpecialEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
1000
	local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
1001
	prt.Anchored = true
1002
	prt.CFrame = cframe
1003
	local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "24388358", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
1004
	game:GetService("Debris"):AddItem(prt, 10)
1005
	table.insert(Effects, {
1006
		prt,
1007
		"Cylinder",
1008
		delay,
1009
		x3,
1010
		y3,
1011
		z3,
1012
		msh
1013
	})
1014
end
1015
1016
function BreakEffect(brickcolor, cframe, x1, y1, z1)
1017
	local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5))
1018
	prt.Anchored = true
1019
	prt.CFrame = cframe * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
1020
	local msh = CreateMesh("SpecialMesh", prt, "Sphere", "nil", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
1021
	local num = math.random(10, 50) / 1000
1022
	game:GetService("Debris"):AddItem(prt, 10)
1023
	table.insert(Effects, {
1024
		prt,
1025
		"Shatter",
1026
		num,
1027
		prt.CFrame,
1028
		math.random() - math.random(),
1029
		0,
1030
		math.random(50, 100) / 100
1031
	})
1032
end
1033
1034
1035
	
1036
1037
	for i = 0, 1, 0.05 do
1038
		swait()
1039
		RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .1)
1040
		Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5), math.rad(0), math.rad(0)), .1)
1041
		RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(5), math.rad(0), math.rad(5)), 0.1)
1042
		LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(20), math.rad(0), math.rad(-10)), 0.3)
1043
		if Torsovelocity > 2 then
1044
		RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-50 * math.cos(sine / 4)), math.rad(0), math.rad(4 * math.cos(sine / 4))), .2)
1045
		RH.C0 = clerp(RH.C0, cn(1, -1 + .1 * math.cos(sine / 5), 0) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(30 * math.cos(sine / 4))), .3)
1046
		LH.C0 = clerp(LH.C0, cn(-1, -1 + .1 * math.cos(sine / 5), 0) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(30 * math.cos(sine / 4))), .3)
1047
		elseif Torsovelocity < 1 then
1048
		RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(5), math.rad(0), math.rad(5)), 0.1)
1049
		RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1)
1050
		LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1)
1051
		end
1052
	end
1053
	attack = false
1054
1055
1056
1057
game:GetService'RunService'.Stepped:connect(function()
1058
	
1059
	
1060
	
1061
	if Wep == 1 then
1062
		equippedgun2 = false
1063
Reaper4.Transparency = 1	
1064
	Reaper5.Transparency = 0
1065
	Reaper6.Transparency = 1
1066
	Reaper7.Transparency = 0
1067
	end
1068
		if Wep == 2 then
1069
			equippedgun2 = true
1070
Reaper4.Transparency = 0	
1071
	Reaper5.Transparency = 1
1072
		Reaper6.Transparency = 0
1073
	Reaper7.Transparency = 1
1074
		end
1075
				if Wep == 3 then
1076
			equippedgun2 = false
1077
Reaper4.Transparency = 1	
1078
	Reaper5.Transparency = 1
1079
			Reaper6.Transparency = 1
1080
	Reaper7.Transparency = 1
1081
		end
1082
		
1083
	Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude 
1084
	velocity = RootPart.Velocity.y
1085
	sine = sine + change
1086
	local hit, pos = rayCast(RootPart.Position, (CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0))).lookVector, 4, Character)
1087
	if equipped == true or equipped == false then
1088
		if RootPart.Velocity.y > 1 and hit == nil then 
1089
			Anim = "Jump"
1090
			if attack == false and Wep == 1 then
1091
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(-5), math.rad(0), math.rad(0)), .1)
1092
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1)
1093
					RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-40), math.rad(0), math.rad(30)), .1)
1094
					LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-40), math.rad(0), math.rad(-30)), .1)
1095
					RH.C0 = clerp(RH.C0, cn(1, -.9, -.3) * RHCF * angles(math.rad(3), math.rad(0), math.rad(0)), .1)
1096
					LH.C0 = clerp(LH.C0, cn(-1, -.7, -.5) * LHCF * angles(math.rad(-3), math.rad(0), math.rad(0)), .1)
1097
			end
1098
		elseif RootPart.Velocity.y < -1 and hit == nil then 
1099
			Anim = "Fall"
1100
			if attack == false and Wep == 1 then
1101
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(10), math.rad(0), math.rad(0)), .1)
1102
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1)
1103
					RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(50)), .1)
1104
					LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-50)), .1)
1105
					RH.C0 = clerp(RH.C0, cn(1, -1, -.3) * RHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1)
1106
					LH.C0 = clerp(LH.C0, cn(-1, -.8, -.3) * LHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1)
1107
			end
1108
		elseif Torsovelocity < 1 and hit ~= nil then
1109
			Anim = "Idle"
1110
			if attack == false and Wep == 1 then
1111
				change = 1
1112
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.1 + 0.1 * math.cos(sine / 25)) * angles(math.rad(0), math.rad(0), math.rad(5)), .1)
1113
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5 - 2 * math.cos(sine / 25)), math.rad(0), math.rad(-5)), .1)
1114
					RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5 - -.1 * math.cos(sine / 25), 0) * angles(math.rad(50), math.rad(35 - 25 * math.cos(sine / 25)), math.rad(5 + 3 * math.cos(sine / 25))), 0.1)
1115
					LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(80 + 7 * math.cos(sine / 25)), math.rad(-30), math.rad(35 - 1 * math.cos(sine / 25))), 0.1)
1116
					RH.C0 = clerp(RH.C0, cn(1, -.9 - 0.1 * math.cos(sine / 25), 0) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1)
1117
					LH.C0 = clerp(LH.C0, cn(-1, -.9 - 0.1 * math.cos(sine / 25), 0) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1)
1118
			end
1119
		elseif Torsovelocity > 2 and hit ~= nil then
1120
			Anim = "Walk"
1121
			if attack == false and Wep == 1 then
1122
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(5 * math.cos(sine / 5))), .2)
1123
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(-5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2)
1124
					RW.C0 = clerp(RW.C0, CFrame.new(1.2 - -.05 * math.cos(sine / 4), 0.5 - -.05 * math.cos(sine / 4), 0) * angles(math.rad(50), math.rad(57 - .1 * math.cos(sine / 25)), math.rad(5 + 3 * math.cos(sine / 25))), 0.1)
1125
					LW.C0 = clerp(LW.C0, CFrame.new(-1.2 - -.05 * math.cos(sine / 4), 0.4 - -.05 * math.cos(sine / 4), -.4) * angles(math.rad(80 + 1 * math.cos(sine / 25)), math.rad(-30), math.rad(35 - 1 * math.cos(sine / 25))), 0.1)
1126
					RH.C0 = clerp(RH.C0, cn(1, -.9 + -.1 * math.cos(sine / 4),0 + -.1 * math.cos(sine / 4)) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3)
1127
					LH.C0 = clerp(LH.C0, cn(-1, -.9 + .1 * math.cos(sine / 4), 0 + .1 * math.cos(sine / 4)) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3)
1128
			end
1129
		end
1130
	end
1131
	-----------------------[Anim2]--------------------------------------------------------------------------------------------------------------------------
1132
	
1133
		if equipped == true or equipped == false then
1134
		if RootPart.Velocity.y > 1 and hit == nil then 
1135
			Anim = "Jump"
1136
			if attack == false and Wep == 2 then
1137
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(-5), math.rad(0), math.rad(0)), .1)
1138
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1)
1139
					RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.2, 0) * angles(math.rad(60), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.1)
1140
					LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.1, -.4) * angles(math.rad(55 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.1)
1141
					RH.C0 = clerp(RH.C0, cn(1, -.9, -.3) * RHCF * angles(math.rad(3), math.rad(0), math.rad(0)), .1)
1142
					LH.C0 = clerp(LH.C0, cn(-1, -.7, -.5) * LHCF * angles(math.rad(-3), math.rad(0), math.rad(0)), .1)
1143
			end
1144
			
1145
		elseif RootPart.Velocity.y < -1 and hit == nil then 
1146
			Anim = "Fall"
1147
			if attack == false and Wep == 2 then
1148
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(10), math.rad(0), math.rad(0)), .1)
1149
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1)
1150
					RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.8, 0) * angles(math.rad(60), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.05)
1151
					LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.7, -.4) * angles(math.rad(55 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.05)
1152
					RH.C0 = clerp(RH.C0, cn(1, -1, -.3) * RHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1)
1153
					LH.C0 = clerp(LH.C0, cn(-1, -.8, -.3) * LHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1)
1154
			end
1155
		elseif Torsovelocity < 1 and hit ~= nil then
1156
			Anim = "Idle"
1157
			if attack == false and Wep == 2 then
1158
				change = 1
1159
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.1 + 0.1 * math.cos(sine / 25)) * angles(math.rad(0), math.rad(0), math.rad(5)), .1)
1160
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5 - 2 * math.cos(sine / 25)), math.rad(0), math.rad(-5)), .1)
1161
					RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(60), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.1)
1162
					LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(55 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.1)
1163
					RH.C0 = clerp(RH.C0, cn(1, -.9 - 0.1 * math.cos(sine / 25), 0) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1)
1164
					LH.C0 = clerp(LH.C0, cn(-1, -.9 - 0.1 * math.cos(sine / 25), 0) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1)
1165
			end
1166
		elseif Torsovelocity > 2 and hit ~= nil then
1167
			Anim = "Walk"
1168
			if attack == false and Wep == 2 then
1169
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(-25 - 5 * math.cos(sine / 5))), .2)
1170
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(25 + 5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2)
1171
					RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(60), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.1)
1172
					LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(55 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.1)
1173
					RH.C0 = clerp(RH.C0, cn(.95, -.9 + -.1 * math.cos(sine / 4),-.35) * RHCF * angles(math.rad(-2), math.rad(25), math.rad(50 * math.cos(sine / 4))), .3)
1174
					LH.C0 = clerp(LH.C0, cn(-.95, -.9 + .1 * math.cos(sine / 4), .35) * LHCF * angles(math.rad(-2), math.rad(25), math.rad(50 * math.cos(sine / 4))), .3)
1175
			end
1176
			
1177
		end
1178
	end
1179
	
1180
	
1181
	
1182
		-----------------------[Noraml Anim]--------------------------------------------------------------------------------------------------------------------------
1183
1184
	if equipped == true or equipped == false then
1185
		if RootPart.Velocity.y > 1 and hit == nil then 
1186
			Anim = "Jump"
1187
			if attack == false and Wep == 3 then
1188
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(-5), math.rad(0), math.rad(0)), .1)
1189
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1)
1190
					RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-40), math.rad(0), math.rad(30)), .1)
1191
					LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-40), math.rad(0), math.rad(-30)), .1)
1192
					RH.C0 = clerp(RH.C0, cn(1, -.9, -.3) * RHCF * angles(math.rad(3), math.rad(0), math.rad(0)), .1)
1193
					LH.C0 = clerp(LH.C0, cn(-1, -.7, -.5) * LHCF * angles(math.rad(-3), math.rad(0), math.rad(0)), .1)
1194
			end
1195
		elseif RootPart.Velocity.y < -1 and hit == nil then 
1196
			Anim = "Fall"
1197
			if attack == false and Wep == 3 then
1198
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(10), math.rad(0), math.rad(0)), .1)
1199
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1)
1200
					RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(50)), .1)
1201
					LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-50)), .1)
1202
					RH.C0 = clerp(RH.C0, cn(1, -1, -.3) * RHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1)
1203
					LH.C0 = clerp(LH.C0, cn(-1, -.8, -.3) * LHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1)
1204
			end
1205
		elseif Torsovelocity < 1 and hit ~= nil then
1206
			Anim = "Idle"
1207
			if attack == false and Wep == 3 then
1208
				change = 1
1209
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.1 + 0.1 * math.cos(sine / 25)) * angles(math.rad(0), math.rad(0), math.rad(5)), .1)
1210
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5 - 2 * math.cos(sine / 25)), math.rad(0), math.rad(-5)), .1)
1211
					RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5 - 0 * math.cos(sine / 25), 0) * angles(math.rad(0), math.rad(0 - 0 * math.cos(sine / 25)), math.rad(5 + 3 * math.cos(sine / 25))), 0.1)
1212
					LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0 + 0 * math.cos(sine / 25)), math.rad(-0), math.rad(-5 - 3 * math.cos(sine / 25))), 0.1)
1213
					RH.C0 = clerp(RH.C0, cn(1, -.9 - 0.1 * math.cos(sine / 25), 0) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1)
1214
					LH.C0 = clerp(LH.C0, cn(-1, -.9 - 0.1 * math.cos(sine / 25), 0) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1)
1215
			end
1216
		elseif Torsovelocity > 2 and hit ~= nil then
1217
			Anim = "Walk"
1218
			if attack == false and Wep == 3 then
1219
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(5 * math.cos(sine / 5))), .2)
1220
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(-5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2)
1221
					RW.C0 = clerp(RW.C0, CFrame.new(1.5 - -0 * math.cos(sine / 4), 0.5 - -.05 * math.cos(sine / 4), 0) * angles(math.rad(10 + -50 * math.cos(sine / 4)), math.rad(0 - .1 * math.cos(sine / 25)), math.rad(5 + 3 * math.cos(sine / 25))), 0.3)
1222
					LW.C0 = clerp(LW.C0, CFrame.new(-1.5 - -0 * math.cos(sine / 4), 0.5 - -.05 * math.cos(sine / 4), 0) * angles(math.rad(10 + 50 * math.cos(sine / 4)), math.rad(-0), math.rad(-5 - 3 * math.cos(sine / 25))), 0.3)
1223
					RH.C0 = clerp(RH.C0, cn(1, -.9 + -.1 * math.cos(sine / 4),0 + -.1 * math.cos(sine / 4)) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3)
1224
					LH.C0 = clerp(LH.C0, cn(-1, -.9 + .1 * math.cos(sine / 4), 0 + .1 * math.cos(sine / 4)) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3)
1225
			end
1226
		end
1227
	end	
1228
	
1229
	
1230
	
1231
	
1232
	
1233
	
1234
	
1235
	
1236
	
1237
	
1238
	
1239
	
1240
	
1241
	
1242
	
1243
	
1244
	
1245
	
1246
	if #Effects > 0 then
1247
		for e = 1, #Effects do
1248
			if Effects[e] ~= nil then
1249
				local Thing = Effects[e]
1250
				if Thing ~= nil then
1251
					local Part = Thing[1]
1252
					local Mode = Thing[2]
1253
					local Delay = Thing[3]
1254
					local IncX = Thing[4]
1255
					local IncY = Thing[5]
1256
					local IncZ = Thing[6]
1257
					if Thing[1].Transparency <= 1 then
1258
						if Thing[2] == "Block1" then
1259
							Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
1260
							local Mesh = Thing[1].Mesh
1261
							Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
1262
							Thing[1].Transparency = Thing[1].Transparency + Thing[3]
1263
						elseif Thing[2] == "Block2" then
1264
							Thing[1].CFrame = Thing[1].CFrame
1265
							local Mesh = Thing[7]
1266
							Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
1267
							Thing[1].Transparency = Thing[1].Transparency + Thing[3]
1268
						elseif Thing[2] == "Cylinder" then
1269
							local Mesh = Thing[1].Mesh
1270
							Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
1271
							Thing[1].Transparency = Thing[1].Transparency + Thing[3]
1272
						elseif Thing[2] == "Blood" then
1273
							local Mesh = Thing[7]
1274
							Thing[1].CFrame = Thing[1].CFrame * Vector3.new(0, .5, 0)
1275
							Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
1276
							Thing[1].Transparency = Thing[1].Transparency + Thing[3]
1277
						elseif Thing[2] == "Elec" then
1278
							local Mesh = Thing[1].Mesh
1279
							Mesh.Scale = Mesh.Scale + Vector3.new(Thing[7], Thing[8], Thing[9])
1280
							Thing[1].Transparency = Thing[1].Transparency + Thing[3]
1281
						elseif Thing[2] == "Disappear" then
1282
							Thing[1].Transparency = Thing[1].Transparency + Thing[3]
1283
						elseif Thing[2] == "Shatter" then
1284
							Thing[1].Transparency = Thing[1].Transparency + Thing[3]
1285
							Thing[4] = Thing[4] * CFrame.new(0, Thing[7], 0)
1286
							Thing[1].CFrame = Thing[4] * CFrame.fromEulerAnglesXYZ(Thing[6], 0, 0)
1287
							Thing[6] = Thing[6] + Thing[5]
1288
						end
1289
					else
1290
						Part.Parent = nil
1291
						table.remove(Effects, e)
1292
					end
1293
				end
1294
			end
1295
		end
1296
	end
1297
end)
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
local No = Instance.new("Sound", head);
1312
No.SoundId = "rbxassetid://245064504"
1313
No.Volume = 3
1314
local yes = Instance.new("Sound", head);
1315
yes.SoundId = "rbxassetid://131384028"
1316
yes.Volume = 3
1317
local HitM = Instance.new("Sound", Reaper5);
1318
HitM.SoundId = "rbxassetid://"..WSH
1319
HitM.Volume = 1.1
1320
local Swing = Instance.new("Sound", Reaper5);
1321
Swing.SoundId = "rbxassetid://10209850"
1322
Swing.Volume = 1.5
1323
Swing.Pitch = 1.1
1324
local SwingH = Instance.new("Sound", Reaper5);
1325
SwingH.SoundId = "rbxassetid://10209590"
1326
SwingH.Volume = 2.9
1327
SwingH.Pitch = .8
1328
local Taunt = Instance.new("Sound", head);
1329
Taunt.SoundId = "rbxassetid://150611842"
1330
Taunt.Volume = 2
1331
local RUS = Instance.new("Sound", char);
1332
RUS.SoundId = "rbxassetid://322621962"
1333
RUS.Volume = 2.5
1334
RUS.Pitch = 1
1335
RUS.Looped = true
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
function BuildSentry()
1347
do --CFrame lerp (stravant, clerp by AntiBoomz0r)
1348
        local function QuaternionFromCFrame(cf)  -- y u no axis angle interpolation?
1349
                local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() 
1350
                local trace = m00 + m11 + m22 
1351
                if trace > 0 then 
1352
                        local s = math.sqrt(1 + trace) 
1353
                        local recip = 0.5/s 
1354
                        return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5 
1355
                else 
1356
                        local i = 0 
1357
                        if m11 > m00 then
1358
                                i = 1 
1359
                        end 
1360
                        if m22 > (i == 0 and m00 or m11) then 
1361
                                i = 2 
1362
                        end 
1363
                        if i == 0 then 
1364
                                local s = math.sqrt(m00-m11-m22+1) 
1365
                                local recip = 0.5/s 
1366
                                return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip 
1367
                        elseif i == 1 then 
1368
                                local s = math.sqrt(m11-m22-m00+1) 
1369
                                local recip = 0.5/s 
1370
                                return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip 
1371
                        elseif i == 2 then 
1372
                                local s = math.sqrt(m22-m00-m11+1) 
1373
                                local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip 
1374
                        end 
1375
                end 
1376
        end
1377
        local function QuaternionToCFrame(px, py, pz, x, y, z, w) 
1378
                local xs, ys, zs = x + x, y + y, z + z 
1379
                local wx, wy, wz = w*xs, w*ys, w*zs 
1380
                local xx = x*xs 
1381
                local xy = x*ys 
1382
                local xz = x*zs 
1383
                local yy = y*ys 
1384
                local yz = y*zs 
1385
                local zz = z*zs 
1386
                return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy)) 
1387
        end   
1388
        function QuaternionSlerp(a, b, t) 
1389
                local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4] 
1390
                local startInterp, finishInterp; 
1391
                if cosTheta >= 0.0001 then 
1392
                        if (1 - cosTheta) > 0.0001 then 
1393
                                local theta = math.acos(cosTheta) 
1394
                                local invSinTheta = 1/math.sin(theta) 
1395
                                startInterp = math.sin((1-t)*theta)*invSinTheta 
1396
                                finishInterp = math.sin(t*theta)*invSinTheta  
1397
                        else 
1398
                                startInterp = 1-t 
1399
                                finishInterp = t 
1400
                        end 
1401
                else
1402
                        if (1+cosTheta) > 0.0001 then 
1403
                                local theta = math.acos(-cosTheta) 
1404
                                local invSinTheta = 1/math.sin(theta) 
1405
                                startInterp = math.sin((t-1)*theta)*invSinTheta 
1406
                                finishInterp = math.sin(t*theta)*invSinTheta 
1407
                        else 
1408
                                startInterp = t-1 
1409
                                finishInterp = t 
1410
                        end 
1411
                end 
1412
                return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp 
1413
        end  
1414
        function clerp(a,b,t) 
1415
                local qa = {QuaternionFromCFrame(a)}
1416
                local qb = {QuaternionFromCFrame(b)} 
1417
                local ax, ay, az = a.x, a.y, a.z 
1418
                local bx, by, bz = b.x, b.y, b.z  
1419
                local _t = 1-t 
1420
                return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t)) 
1421
        end 
1422
end
1423
1424
1425
1426
1427
local ABS = math.abs;
1428
local SIN = math.sin;
1429
local ASIN = math.asin;
1430
local COS = math.cos;
1431
1432
local new = Instance.new;
1433
1434
function math_pos(float)
1435
    if float < 0 then float = 0 end
1436
    return float
1437
end
1438
function math_neg(float)
1439
    if float > 0 then float = 0 end
1440
    return float
1441
end
1442
function math_max(float, max)
1443
    if float > max then float = max end
1444
    return float
1445
end
1446
function math_min(float, min)
1447
    if float > min then float = min end
1448
    return float
1449
end
1450
1451
function SharpSin(double_p1)
1452
    return ASIN(SIN(double_p1));
1453
end
1454
1455
local Storage = Instance.new("Model", script);
1456
1457
function WeldP(part0, part1, C0, C1)
1458
    local W = new("Weld", Storage);
1459
    W.Part0 = part0;
1460
    W.Part1 = part1;
1461
    W.C0 = C0 or CFrame.new();
1462
    W.C1 = C1 or CFrame.new();
1463
    return W;
1464
end
1465
1466
function Bevel(part, sizeV3)
1467
    local BvlMesh = new("SpecialMesh", part)
1468
    BvlMesh.MeshId = "rbxasset://fonts/torso.mesh";
1469
    if (sizeV3 ~= nil) then
1470
        BvlMesh.Scale = Vector3.new(sizeV3.x/2, sizeV3.y/2, sizeV3.z);
1471
    else
1472
        BvlMesh.Scale = Vector3.new(part.Size.x/2, part.Size.y/2, part.Size.z);
1473
    end
1474
end
1475
1476
1477
1478
local Scale = 0.5 -- 1 is size of a robloxian (mostly);
1479
1480
Storage.Name = "ä";
1481
1482
local BasePart = new("Part");
1483
BasePart.FormFactor = "Custom";
1484
BasePart.TopSurface = 10;
1485
BasePart.BottomSurface = 10;
1486
BasePart.LeftSurface = 10;
1487
BasePart.RightSurface = 10;
1488
BasePart.FrontSurface = 10;
1489
BasePart.BackSurface = 10;
1490
1491
local CylPart = new("Part");
1492
CylPart.FormFactor = "Custom";
1493
CylPart.TopSurface = 10;
1494
CylPart.BottomSurface = 10;
1495
CylPart.LeftSurface = 10;
1496
CylPart.RightSurface = 10;
1497
CylPart.FrontSurface = 10;
1498
CylPart.BackSurface = 10;
1499
new("CylinderMesh", CylPart);
1500
1501
local TopFrame = BasePart:clone()
1502
TopFrame.Parent = Storage;
1503
TopFrame.Size = Vector3.new(3.5*Scale, 1.5*Scale, 3.5*Scale);
1504
TopFrame.BrickColor = TeamColor;
1505
1506
new("CylinderMesh", TopFrame);
1507
1508
local Screw = CylPart:clone();
1509
Screw.Parent = Storage;
1510
Screw.Size = Vector3.new(.3*Scale, 1.6*Scale, .3*Scale);
1511
Screw.BrickColor = BrickColor.new(199);
1512
1513
local CGreyStyle = CylPart:clone()
1514
CGreyStyle.Parent = Storage;
1515
CGreyStyle.Size = Vector3.new(2.2*Scale, 1.52*Scale, 2.6*Scale);
1516
CGreyStyle.BrickColor = BrickColor.new(199);
1517
1518
local TurretCasing = BasePart:clone();
1519
TurretCasing.Size = Vector3.new(2.2*Scale, 1.4*Scale, 5.6*Scale);
1520
TurretCasing.BrickColor = BrickColor.new(199);
1521
TurretCasing.Parent = Storage;
1522
1523
Bevel(TurretCasing);
1524
1525
local TurretFront = BasePart:clone();
1526
TurretFront.Size = Vector3.new(1.7*Scale, 1*Scale, .2*Scale);
1527
TurretFront.BrickColor = TeamColor;
1528
TurretFront.Parent = Storage;
1529
1530
local Barrel = CylPart:clone();
1531
Barrel.Parent = Storage;
1532
Barrel.Size = Vector3.new(.7*Scale, .4*Scale, .7*Scale);
1533
Barrel.BrickColor = BrickColor.Black();
1534
1535
1536
        local Particle = Instance.new("ParticleEmitter", Barrel);
1537
        Particle.VelocitySpread = 30;
1538
        Particle.LightEmission = 200;
1539
1540
        local Colors = {Color3.new(1,.5,0), Color3.new(1,.7,0), Color3.new(1,.9,0);}
1541
1542
        Particle.Size = NumberSequence.new(.05,.07);
1543
1544
        Particle.Color = ColorSequence.new(Colors[math.random(#Colors)]);
1545
        Particle.Texture = "rbxassetid://252350680";
1546
        Particle.RotSpeed = NumberRange.new(10,70);
1547
        Particle.Rate = 300;
1548
        Particle.Speed = NumberRange.new(15);
1549
        Particle.Transparency = NumberSequence.new(0,1);
1550
        Particle.Lifetime = NumberRange.new(.01,.2);
1551
Particle.Enabled = false
1552
1553
1554
1555
local RedDot = BasePart:clone();
1556
RedDot.Parent = Storage;
1557
RedDot.Size = Vector3.new(.2*Scale, .2*Scale, .2*Scale);
1558
RedDot.BrickColor = BrickColor.new("Really red");
1559
1560
local Sphere = Instance.new("SpecialMesh", RedDot);
1561
Sphere.MeshType = "Sphere";
1562
Sphere.Scale = Vector3.new(1*Scale,1*Scale,1*Scale);
1563
1564
1565
Bevel(TurretFront, Vector3.new(1.7*Scale, 1*Scale, .05*Scale));
1566
1567
local Joint = CylPart:clone();
1568
Joint.Parent = Storage;
1569
Joint.Size = Vector3.new(.7*Scale, 2*Scale, .7*Scale);
1570
Joint.BrickColor = BrickColor.Black();
1571
1572
local Hold = BasePart:clone();
1573
Hold.Parent = Storage;
1574
Hold.BrickColor = BrickColor.Black();
1575
Hold.Size = Vector3.new(2.2*Scale, .2*Scale, .75*Scale);
1576
1577
local Bolt = BasePart:clone();
1578
Bolt.Size = Vector3.new(.2*Scale, 1.5*Scale, .5*Scale);
1579
Bolt.Parent = Storage;
1580
Bolt.BrickColor = BrickColor.Black();
1581
1582
local Bolt2 = BasePart:clone();
1583
Bolt2.Size = Vector3.new(.2*Scale, 1.5*Scale, .5*Scale);
1584
Bolt2.Parent = Storage;
1585
Bolt2.BrickColor = BrickColor.Black();
1586
1587
1588
local TurretToFrame = WeldP(TopFrame, TurretCasing, CFrame.new(0, 0, 1.4*Scale));
1589
WeldP(TopFrame, CGreyStyle);
1590
WeldP(TurretCasing, TurretFront, CFrame.new(0, 0, 2.8*Scale));
1591
WeldP(TopFrame, Screw);
1592
local BarrelWeld = WeldP(Barrel, TurretFront, CFrame.new(.3*Scale, -.2*Scale, 0), CFrame.Angles(math.pi/2, 0, 0));
1593
1594
WeldP(RedDot, TurretFront, CFrame.new(-.55*Scale, 0, -.15*Scale), CFrame.Angles(math.pi/2, 0, 0));
1595
1596
local RotateAxisY = WeldP(Bolt, TurretCasing, CFrame.Angles(0,0,0), CFrame.new(1.1*Scale, -.75*Scale, 1*Scale));
1597
1598
WeldP(Bolt, Hold, CFrame.new(-1.1*Scale, -.5*Scale, 0));
1599
1600
WeldP(Bolt2, Hold, CFrame.new(1.1*Scale, -.5*Scale, 0));
1601
1602
local RotateAxisX = WeldP(Hold, Joint, CFrame.new(0, -1*Scale, 0));
1603
1604
1605
1606
local Leg1 = BasePart:clone();
1607
Leg1.Size = Vector3.new(.2*Scale, 3.5*Scale, .5*Scale);
1608
Leg1.Parent = Storage;
1609
Leg1.BrickColor = BrickColor.Black();
1610
1611
1612
WeldP(Leg1, Joint, CFrame.new(0, -1.75*Scale, 0), CFrame.new(0, -.75*Scale, 0) * CFrame.Angles(math.pi/3, 0, math.pi));
1613
1614
1615
local Leg2 = BasePart:clone();
1616
Leg2.Size = Vector3.new(.2*Scale, 3.5*Scale, .5*Scale);
1617
Leg2.Parent = Storage;
1618
Leg2.BrickColor = BrickColor.Black();
1619
1620
1621
WeldP(Leg2, Joint, CFrame.new(0, -1.75*Scale, 0), CFrame.new(0, -.45*Scale, 0) * CFrame.Angles(-math.pi/4, 0, math.pi + -math.pi/6));
1622
1623
1624
local Leg3 = BasePart:clone();
1625
Leg3.Size = Vector3.new(.2*Scale, 3.5*Scale, .5*Scale);
1626
Leg3.Parent = Storage;
1627
Leg3.BrickColor = BrickColor.Black();
1628
1629
1630
WeldP(Leg3, Joint, CFrame.new(0, -1.75*Scale, 0), CFrame.new(0, -.45*Scale, 0) * CFrame.Angles(-math.pi/4, 0, math.pi + math.pi/6));
1631
1632
	for i,v in pairs(Storage:children()) do
1633
		if v.Name== "Part" then
1634
			trans = 1
1635
			v.Transparency = 1
1636
		end
1637
		end
1638
1639
local InvisiBox = BasePart:clone();
1640
InvisiBox.Size = Storage:GetModelSize() + Vector3.new(2*Scale, 0, 0);
1641
InvisiBox.Parent = Storage;
1642
InvisiBox.Transparency = 1
1643
InvisiBox.Name = 'box'
1644
WeldP(InvisiBox, Joint, CFrame.new(0, -.2*Scale, .97*Scale));
1645
1646
local InvisiBox2 = BasePart:clone();
1647
InvisiBox2.Size = Storage:GetModelSize() + Vector3.new(2*Scale, 0, 0);
1648
InvisiBox2.Parent = Arms;
1649
InvisiBox2.Transparency = .9
1650
InvisiBox2.Name = 'box'
1651
InvisiBox2.CanCollide = false
1652
InvisiBox2.BrickColor = TeamColor
1653
InvisiBox2.Material = 'Neon'
1654
WeldP(InvisiBox2, Joint, CFrame.new(0, -1.2*Scale, .97*Scale));
1655
1656
InvisiBox.CFrame = torso.CFrame * CFrame.new(0, 5.5*Scale, -2.9) * CFrame.Angles(0, math.pi, 0);
1657
1658
local Action = "Idle";
1659
1660
local Target = nil;
1661
1662
wait(1)
1663
1664
InvisiBox.Anchored = true
1665
1666
for i,v in pairs(Storage:children()) do
1667
    if v:IsA'Part' then
1668
        v.Locked = true
1669
    end
1670
end
1671
--//
1672
--// SOUNDS
1673
--//
1674
	for i,v in pairs(Storage:children()) do
1675
		if v.Name== "Part" then
1676
			trans = 1
1677
			v.Transparency = 1
1678
		end
1679
		end
1680
	for i,v in pairs(Storage:children()) do
1681
		if v.Name== "Part" then
1682
			trans = 1
1683
			v.Transparency = 1
1684
		for i = 1,11 do
1685
				
1686
			trans = trans - .1
1687
			v.Transparency = trans
1688
			wait()
1689
			end
1690
			end
1691
	end
1692
	trans = 1
1693
1694
local OnFind = new("Sound", TopFrame);
1695
OnFind.SoundId = "rbxassetid://10209260"
1696
OnFind.Volume = 1
1697
1698
1699
local OnFire = new("Sound", TopFrame);
1700
OnFire.SoundId = "rbxassetid://10209257"
1701
OnFire.Volume = 1
1702
1703
local OnEmpty = new("Sound", TopFrame);
1704
OnEmpty.SoundId = "rbxassetid://10209225"
1705
OnEmpty.Volume = 1
1706
1707
local Scanning = new("Sound", TopFrame);
1708
Scanning.SoundId = "rbxassetid://258704234"
1709
Scanning.Volume = 1
1710
1711
local Explode = new("Sound", TopFrame);
1712
Explode.SoundId = "rbxassetid://10209236"
1713
Explode.Volume = .5
1714
1715
local Move = new("Sound", TopFrame);
1716
Move.SoundId = "rbxassetid://258704467";
1717
Move.Volume = 1;
1718
1719
1720
1721
1722
1723
function FindShortest(Table)
1724
local Current = Table[1]
1725
local Final
1726
for _,v in pairs(Table) do
1727
if v[2] ~= Current[2] then
1728
if v[1] < Current[1] then
1729
Current = v
1730
end
1731
end
1732
end
1733
Final = Current
1734
return Final
1735
end
1736
1737
function GetNearbyPlayer()
1738
1739
    local List = {}
1740
    for i,v in pairs(workspace:children()) do
1741
        if (v ~= nil) then
1742
            if (v:IsA'Model') then
1743
                if (v:findFirstChild'Torso' ~= nil) then
1744
                    local rx, ry, rz = Hold.CFrame:toEulerAnglesXYZ();
1745
                    if (v:findFirstChild'Torso'.Position - Hold.CFrame * CFrame.new(0, 0, 20) * CFrame.Angles(0, ry, 0).p).magnitude < 20 then
1746
                        if (v ~= char) then
1747
                            for x,z in next, v:children() do
1748
                                if z:IsA'Humanoid' and z.Health > 0.01 then
1749
                                    table.insert(List, {(v:findFirstChild'Torso'.Position - Hold.CFrame * CFrame.new(0, 0, 20) * CFrame.Angles(0, ry, 0).p).magnitude, v})
1750
                                end
1751
                            end
1752
                        end
1753
                    end
1754
                end
1755
            end
1756
        end
1757
    end
1758
    if (FindShortest(List) ~= nil) then
1759
        return FindShortest(List)[2];
1760
    else
1761
        return nil;
1762
    end
1763
end
1764
1765
local Health = Instance.new("Humanoid", Storage);
1766
Health.MaxHealth = 150;
1767
Health.Health = 150;
1768
1769
1770
1771
function RayC(Part, speed)
1772
    coroutine.wrap(function()
1773
        local Visual = BasePart:clone();
1774
        Visual.FormFactor = "Custom";
1775
        Visual.BrickColor = BrickColor.Yellow();
1776
        Visual.Size = Vector3.new(.2, 3, .2);
1777
        Visual.CFrame = Part.CFrame * CFrame.new(0, -1, 0);
1778
        Visual.Anchored = true;
1779
        Visual.CanCollide = false;
1780
        Visual.Locked = true
1781
1782
1783
        coroutine.wrap(function()
1784
1785
            wait(.2)
1786
            
1787
            wait(.1);
1788
            wait(.3)
1789
1790
        end)()
1791
1792
        Instance.new("SpecialMesh", Visual).MeshType = "Sphere";
1793
        Visual.Mesh.Scale = Vector3.new(.5, 1, .5);
1794
1795
        local bulletpos = Visual.Position
1796
        local bulletvelocity = (Part.CFrame.p - bulletpos).unit*speed
1797
        local lastbulletpos = Visual.Position 
1798
        Visual.Parent = Storage;
1799
        while game:service'RunService'.Stepped:wait() do
1800
1801
                    lastbulletpos = bulletpos 
1802
                    bulletpos = bulletpos + bulletvelocity
1803
                    local RayCast = Ray.new(lastbulletpos, (bulletpos - lastbulletpos))
1804
                    local hit, hitpos = workspace:FindPartOnRay(RayCast, Storage, false, true)
1805
                    if (Joint.Position - Visual.Position).magnitude > 1000 or Visual.Parent == nil then
1806
                        Visual:Destroy();
1807
                        break
1808
                    end
1809
                    Visual.Anchored = true
1810
                    Visual.CFrame = CFrame.new(bulletpos, bulletpos+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0);
1811
                    if hit then
1812
                        if hit.Parent:IsA'Hat' then
1813
                            if hit.Parent.Parent:IsA'Model' then
1814
                                for x,z in next, hit.Parent.Parent:children() do
1815
                                    if z:IsA'Humanoid' then
1816
                                        z:TakeDamage(math.random(8,12));
1817
                                    end
1818
                                end
1819
                            end
1820
                        else
1821
                            if hit.Parent:IsA'Model' then
1822
                                for x,z in next, hit.Parent:children() do
1823
                                    if z:IsA'Humanoid' then
1824
                                        z:TakeDamage(math.random(8,12));
1825
                                    end
1826
                                end
1827
                            end
1828
                        end
1829
1830
                        Visual:Destroy();
1831
                        break
1832
                    end
1833
        end
1834
    end)()
1835
end
1836
1837
lastTick = tick();
1838
local db = false;
1839
game:service'RunService'.RenderStepped:connect(function()
1840
    if Action == "DEAD" then return end;
1841
1842
1843
    if not Wrangler then
1844
        --//
1845
        --// AUTOMATED MODE, MOTION SENSOR WILL DETECT MOVEMENT
1846
        --//
1847
1848
1849
        --//
1850
        --// IF PLAYER USED WRANGLER, THERE IS A SHIELD WICH MUST BE REMOVED
1851
        --// 
1852
1853
        if (Storage:findFirstChild'Shield') then
1854
            Storage:findFirstChild'Shield':Destroy();
1855
        end
1856
1857
        local LastTarget = Target;
1858
1859
        --//
1860
        --// CHECK FOR NEARBY ENEMIES
1861
        --//
1862
        local Player = GetNearbyPlayer();
1863
        Target = Player;
1864
1865
        --//
1866
        --// BEEP ON TARGET FOUND
1867
        --//
1868
        if (Target ~= LastTarget and Target ~= nil) then
1869
            Move.Pitch = 0.9 + math.random()/9;
1870
            Move:play();
1871
            OnFind:play();
1872
            Action = "Standby";
1873
        end
1874
1875
        --//
1876
        --// IDLE
1877
        --//
1878
        if Action == "Idle" then
1879
            RotateAxisX.C1 = clerp(RotateAxisX.C1, CFrame.Angles(0, SharpSin(tick()*2)*.2, 0), .1);
1880
            RotateAxisY.C0 = clerp(RotateAxisY.C0, CFrame.new(), .1);
1881
        end
1882
1883
1884
        --//
1885
        --// SENTRY DEAD
1886
        --//
1887
1888
        --//
1889
        --// IF PLAYER EXISTS, FIRE!
1890
        --//
1891
1892
1893
1894
        if Action == "Standby" then
1895
            pcall(function()
1896
                local tor = Target.Torso.CFrame.p -- Target CFrame
1897
                local direction = InvisiBox.CFrame.lookVector -- Direction handling, welds mess up, just a workaround.
1898
                local heading = math.atan2(direction.x, direction.z)--
1899
                local RotY = math.deg(heading)
1900
                    if RotY < 0 then
1901
                        RotY = (360 - math.abs(RotY));
1902
                    end
1903
                RotateAxisX.C1 = --Begin here
1904
                clerp(RotateAxisX.C1, 
1905
                CFrame.new(
1906
1907
                  Vector3.new(), --The Pivot0 of pointing the weld.
1908
                  Vector3.new(tor.x, 0, tor.z) - Vector3.new(RotateAxisX.Part1.CFrame.x, 0, RotateAxisX.Part1.CFrame.z)) --We point the sentry here
1909
1910
                * CFrame.Angles(0, math.rad(360) - math.rad(RotY), 0), 
1911
                .1
1912
                );
1913
                
1914
                local Point = Hold.CFrame:toObjectSpace(CFrame.new(Hold.CFrame.p,tor))*CFrame.Angles(0,math.rad(180),0)
1915
                local RX, RY, RZ = Point:toEulerAnglesXYZ()
1916
                if math.deg(RX) > 45 then
1917
                    RX = math.rad(45)
1918
                elseif math.deg(RX) < -55 then
1919
                    RX = math.rad(-55)
1920
                end
1921
                RotateAxisY.C0 = clerp(RotateAxisY.C0,CFrame.Angles(RX,0,0),.1)
1922
                
1923
            end)
1924
        end
1925
        if Action == "Fire" then
1926
            pcall(function()
1927
                local tor = Target.Torso.CFrame.p;
1928
                local direction = InvisiBox.CFrame.lookVector
1929
                local heading = math.atan2(direction.x, direction.z)
1930
                local RotY = math.deg(heading)
1931
                    if RotY < 0 then
1932
                        RotY = (360 - math.abs(RotY));
1933
                    end
1934
                RotateAxisX.C1 = --Begin here
1935
                clerp(RotateAxisX.C1, 
1936
                CFrame.new(
1937
1938
                  Vector3.new(), --The Pivot0 of pointing the weld.
1939
                  Vector3.new(tor.x, 0, tor.z) - Vector3.new(RotateAxisX.Part1.CFrame.x, 0, RotateAxisX.Part1.CFrame.z)) --We point the sentry here
1940
1941
                * CFrame.Angles(0, math.rad(360) - math.rad(RotY), 0), 
1942
                .1
1943
                );
1944
1945
                BarrelWeld.C0 = clerp(BarrelWeld.C0, CFrame.new())
1946
                local Point = Hold.CFrame:toObjectSpace(CFrame.new(Hold.CFrame.p,tor))*CFrame.Angles(0,math.rad(180),0)
1947
                local RX, RY, RZ = Point:toEulerAnglesXYZ()
1948
                if math.deg(RX) > 45 then
1949
                    RX = math.rad(45)
1950
                elseif math.deg(RX) < -55 then
1951
                    RX = math.rad(-55)
1952
                end
1953
                RotateAxisY.C0 = clerp(RotateAxisY.C0,CFrame.Angles(RX,0,0),.1)
1954
            end)
1955
        end
1956
1957
        if (Target ~= nil) then
1958
            if Action == "Fire" or db then return end
1959
            if Action == "Standby" then
1960
                db = true
1961
                wait(.2);
1962
            end
1963
            Action = "Fire";
1964
            db = false
1965
            OnFire:play();
1966
1967
        Particle.Color = ColorSequence.new(Colors[math.random(#Colors)]);
1968
1969
            local PointLight = Instance.new("PointLight", Barrel);
1970
            PointLight.Color = Color3.new(1,.8,0)
1971
            PointLight.Brightness = 6;
1972
Particle.Enabled = true
1973
            game:service'Debris':AddItem(PointLight, .05);
1974
1975
1976
1977
            RayC(Barrel, 20)
1978
1979
1980
1981
1982
            wait(.1)
1983
Particle.Enabled = false
1984
            if (Target ~= nil) then
1985
                Action = "Standby";
1986
            else
1987
                Action = "Idle";
1988
            end
1989
        end
1990
1991
        if tick() - lastTick > 2.5 and Target == nil then
1992
            lastTick = tick();
1993
            Scanning:play();
1994
        end
1995
    end
1996
1997
    if (Health.Health < 0.0001 or RotateAxisX.Parent == nil) then
1998
            Action = "DEAD";
1999
            if db then return end
2000
            RotateAxisY:Destroy();
2001
            TurretToFrame:Destroy();
2002
            Joint:Destroy();
2003
InvisiBox2:Destroy();
2004
            db = true
2005
            local expl = Instance.new("Explosion", Storage);
2006
            
2007
expl.BlastRadius = .3;
2008
expl.BlastPressure = 2050000;
2009
            expl.Position = TopFrame.Position;
2010
Explode:Play()
2011
NoSentry = true
2012
            game:service'Debris':AddItem(Storage, 3);
2013
            
2014
        end 
2015
2016
end)
2017
end
2018
2019
2020
2021
combo = 0
2022
	function strike(hit)
2023
		if hit and hit.Parent and hit.Parent.Name ~= char.Name then
2024
			local targetHumanoid = hit.Parent:FindFirstChild("Humanoid")
2025
			if targetHumanoid and targetHumanoid ~= char:FindFirstChild("Humanoid") then
2026
				if combo == 1 then
2027
					targetHumanoid:TakeDamage(slashDamage)
2028
					SwingH:Play()
2029
				
2030
				end
2031
2032
2033
2034
			end
2035
		end
2036
	end
2037
2038
2039
2040
Reaper5.Touched:connect(strike)
2041
--------------------------------------------------------------------------------------------------------------------------
2042
		function AnimSit()
2043
			for i = 0, 1, 0.05 do
2044
				
2045
		swait()
2046
		RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, -1, -.6) * angles(math.rad(0), math.rad(0), math.rad(0)), .1)
2047
		Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(0)), .1)
2048
		LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.3, .1) * angles(math.rad(20), math.rad(0), math.rad(20)), 0.1)
2049
		RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(0), math.rad(0), math.rad(5)), 0.1)
2050
		RH.C0 = clerp(RH.C0, cn(1, -.4, -.4) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1)
2051
		LH.C0 = clerp(LH.C0, cn(-1, -1, -.6) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(60)), .1)
2052
		end
2053
			
2054
		end
2055
		
2056
		function AnimSitHit1()
2057
			for i = 0, 1, 0.05 do
2058
				
2059
		swait()
2060
		RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, -1, -.6) * angles(math.rad(10), math.rad(0), math.rad(0)), .1)
2061
		Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5), math.rad(0), math.rad(0)), .1)
2062
		LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.3, .1) * angles(math.rad(20), math.rad(0), math.rad(20)), 0.1)
2063
		RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(170), math.rad(0), math.rad(-5)), 0.08)
2064
		RH.C0 = clerp(RH.C0, cn(1, -.4, -.4) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(10)), .1)
2065
		LH.C0 = clerp(LH.C0, cn(-1, -1, -.6) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(50)), .1)
2066
		end
2067
			
2068
		end
2069
		
2070
		
2071
				function AnimSitHit2()
2072
			for i = 0, 1, 0.05 do
2073
				
2074
		swait()
2075
		RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, -1, -.6) * angles(math.rad(0), math.rad(0), math.rad(0)), .1)
2076
		Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(15), math.rad(0), math.rad(0)), .1)
2077
		LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.3, .1) * angles(math.rad(20), math.rad(0), math.rad(20)), 0.1)
2078
		RW.C0 = clerp(RW.C0, CFrame.new(1.55, 0.4, -.1) * angles(math.rad(40), math.rad(3 ), math.rad(-15)), 0.3)
2079
		RH.C0 = clerp(RH.C0, cn(1, -.4, -.4) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1)
2080
		LH.C0 = clerp(LH.C0, cn(-1, -1, -.6) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(60)), .1)
2081
		end
2082
			
2083
			end		
2084
--------------------------------------------------------------------------------------------------------------------------
2085
2086
				function No1()
2087
			for i = 0, 1, 0.05 do
2088
				
2089
		swait()
2090
		RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,0) * angles(math.rad(0), math.rad(0), math.rad(0)), .1)
2091
		Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(30), math.rad(0), math.rad(40)), .1)
2092
		LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, -.1) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.1)
2093
		RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(30), math.rad(0), math.rad(0)), 0.1)
2094
		RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1)
2095
		LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1)
2096
		end
2097
			
2098
			end	
2099
2100
2101
2102
				function No2()
2103
			for i = 0, 1, 0.05 do
2104
				
2105
		swait()
2106
		RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,0) * angles(math.rad(0), math.rad(0), math.rad(0)), .1)
2107
		Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(-40)), .1)
2108
		LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, -.1) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.1)
2109
		RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(30), math.rad(0), math.rad(0)), 0.1)
2110
		RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1)
2111
		LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1)
2112
		end
2113
			
2114
			end	
2115
2116
2117
2118
--------------------------------------------------------------------------------------------------------------------------
2119
2120
				function Yes1()
2121
			for i = 0, 1, 0.1 do
2122
				
2123
		swait()
2124
		RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,0) * angles(math.rad(0), math.rad(0), math.rad(0)), .1)
2125
		Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(25), math.rad(0), math.rad(0)), .1)
2126
		LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, -.1) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.1)
2127
		RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(30), math.rad(0), math.rad(0)), 0.1)
2128
		RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1)
2129
		LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1)
2130
		end
2131
			
2132
			end	
2133
2134
2135
2136
				function Yes2()
2137
			for i = 0, 1, 0.1 do
2138
				
2139
		swait()
2140
		RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,0) * angles(math.rad(0), math.rad(0), math.rad(0)), .1)
2141
		Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1)
2142
		LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, -.1) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.1)
2143
		RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(30), math.rad(0), math.rad(0)), 0.1)
2144
		RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1)
2145
		LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1)
2146
		end
2147
			
2148
			end	
2149
2150
2151
2152
--------------------------------------------------------------------------------------------------------------------------
2153
function AttackAnim1()
2154
for i = 0, 1, 0.05 do
2155
		swait()
2156
		RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(-5), math.rad(0), math.rad(0)), .1)
2157
		Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5), math.rad(0), math.rad(0)), .1)
2158
		RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(170), math.rad(0), math.rad(10)), 0.08)
2159
		LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(40), math.rad(0), math.rad(10)), 0.3)
2160
		if Torsovelocity > 2 then
2161
		RH.C0 = clerp(RH.C0, cn(1, -1 + .1 * math.cos(sine / 5), 0) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(30 * math.cos(sine / 4))), .3)
2162
		LH.C0 = clerp(LH.C0, cn(-1, -1 + .1 * math.cos(sine / 5), 0) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(30 * math.cos(sine / 4))), .3)
2163
		elseif Torsovelocity < 1 then
2164
		RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(-5)), .1)
2165
		LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(5)), .1)
2166
		end
2167
end
2168
end
2169
2170
2171
function AttackAnim2()
2172
for i = 0, 1, 0.05 do
2173
		swait()
2174
		RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(5), math.rad(0), math.rad(0)), .2)
2175
		Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5), math.rad(0), math.rad(0)), .1)
2176
		RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(5), math.rad(10), math.rad(-10)), 0.25)
2177
		LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(20), math.rad(0), math.rad(10)), 0.3)
2178
		if Torsovelocity > 2 then
2179
					RH.C0 = clerp(RH.C0, cn(1, -.9 + -.1 * math.cos(sine / 4),0 + -.1 * math.cos(sine / 4)) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3)
2180
					LH.C0 = clerp(LH.C0, cn(-1, -.9 + .1 * math.cos(sine / 4), 0 + .1 * math.cos(sine / 4)) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3)
2181
	
2182
		elseif Torsovelocity < 1 then
2183
		RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(5)), .1)
2184
		LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(-5)), .1)
2185
		end
2186
end
2187
end
2188
--------------------------------------------------------------------------------------------------------------------------
2189
2190
2191
2192
function ShotAttackAnim1()
2193
for i = 0, 1, 0.07 do
2194
		swait()
2195
2196
		if Torsovelocity > 2 then
2197
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(-50 - 5 * math.cos(sine / 5))), .2)
2198
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(50 + 5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2)
2199
					RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(90), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.2)
2200
					LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(85 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.2)
2201
					RH.C0 = clerp(RH.C0, cn(.9, -.9 + -.1 * math.cos(sine / 4),-.6) * RHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3)
2202
					LH.C0 = clerp(LH.C0, cn(-.9, -.9 + .1 * math.cos(sine / 4),  .5) * LHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3)				
2203
				
2204
				
2205
2206
		elseif Torsovelocity < 1 then
2207
			
2208
			
2209
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-50)), .2)
2210
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(50)), .2)
2211
					RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(90), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.2)
2212
					LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(85 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.2)
2213
					RH.C0 = clerp(RH.C0, cn(.9, -.9 - 0.1 * math.cos(sine / 25), -.6) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2)
2214
					LH.C0 = clerp(LH.C0, cn(-.9, -.9 - 0.1 * math.cos(sine / 25), .5) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2)			
2215
			
2216
2217
		end
2218
end
2219
end
2220
2221
2222
2223
2224
2225
function ShotAttackAnim2()
2226
for i = 0, 1, 0.05 do
2227
		swait()
2228
2229
		if Torsovelocity > 2 then
2230
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(-50 - 5 * math.cos(sine / 5))), .2)
2231
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(50 + 5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2)
2232
					RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(100), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.1)
2233
					LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(75 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.1)
2234
					RH.C0 = clerp(RH.C0, cn(.9, -.9 + -.1 * math.cos(sine / 4),-.6) * RHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3)
2235
					LH.C0 = clerp(LH.C0, cn(-.9, -.9 + .1 * math.cos(sine / 4),  .5) * LHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3)				
2236
				
2237
				
2238
2239
		elseif Torsovelocity < 1 then
2240
			
2241
			
2242
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-50)), .2)
2243
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(50)), .2)
2244
					RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(100), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.1)
2245
					LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(75 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.1)
2246
					RH.C0 = clerp(RH.C0, cn(.9, -.9 - 0.1 * math.cos(sine / 25), -.6) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2)
2247
					LH.C0 = clerp(LH.C0, cn(-.9, -.9 - 0.1 * math.cos(sine / 25), .5) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2)			
2248
			
2249
2250
		end
2251
end
2252
end
2253
2254
2255
2256
function ShotAttackAnim3()
2257
for i = 0, 1, 0.05 do
2258
		swait()
2259
2260
		if Torsovelocity > 2 then
2261
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(-50 - 5 * math.cos(sine / 5))), .2)
2262
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(50 + 5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2)
2263
					RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.56, -.2) * angles(math.rad(45), math.rad(-20 - .01 * math.cos(sine / 25)), math.rad(-70 + 0.1 * math.cos(sine / 25))), 0.2)
2264
					LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.6, -.6) * angles(math.rad(115 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-30 - 1 * math.cos(sine / 25))), 0.2)
2265
					RH.C0 = clerp(RH.C0, cn(.9, -.9 + -.1 * math.cos(sine / 4),-.6) * RHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3)
2266
					LH.C0 = clerp(LH.C0, cn(-.9, -.9 + .1 * math.cos(sine / 4),  .5) * LHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3)				
2267
				
2268
				
2269
2270
		elseif Torsovelocity < 1 then
2271
			
2272
			
2273
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-50)), .2)
2274
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(50)), .2)
2275
					RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.56, -.2) * angles(math.rad(45), math.rad(-20 - .01 * math.cos(sine / 25)), math.rad(-70 + 0.1 * math.cos(sine / 25))), 0.2)
2276
					LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.6, -.6) * angles(math.rad(115 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-30 - 1 * math.cos(sine / 25))), 0.2)
2277
					RH.C0 = clerp(RH.C0, cn(.9, -.9 - 0.1 * math.cos(sine / 25), -.6) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2)
2278
					LH.C0 = clerp(LH.C0, cn(-.9, -.9 - 0.1 * math.cos(sine / 25), .5) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2)			
2279
			
2280
2281
		end
2282
end
2283
end
2284
2285
function ShotAttackAnim4()
2286
for i = 0, 1, 0.05 do
2287
		swait()
2288
2289
		if Torsovelocity > 2 then
2290
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(-50 - 5 * math.cos(sine / 5))), .2)
2291
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(50 + 5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2)
2292
					RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.56, 0) * angles(math.rad(45), math.rad(-20 - .01 * math.cos(sine / 25)), math.rad(-70 + 0.1 * math.cos(sine / 25))), 0.2)
2293
					LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.6, -.8) * angles(math.rad(115 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-50 - 1 * math.cos(sine / 25))), 0.2)
2294
					RH.C0 = clerp(RH.C0, cn(.9, -.9 + -.1 * math.cos(sine / 4),-.6) * RHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3)
2295
					LH.C0 = clerp(LH.C0, cn(-.9, -.9 + .1 * math.cos(sine / 4),  .5) * LHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3)				
2296
				
2297
				
2298
2299
		elseif Torsovelocity < 1 then
2300
			
2301
			
2302
					RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-50)), .2)
2303
					Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(50)), .2)
2304
					RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.56, 0) * angles(math.rad(45), math.rad(-20 - .01 * math.cos(sine / 25)), math.rad(-70 + 0.1 * math.cos(sine / 25))), 0.2)
2305
					LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.6, -.8) * angles(math.rad(115 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-50 - 1 * math.cos(sine / 25))), 0.2)
2306
					RH.C0 = clerp(RH.C0, cn(.9, -.9 - 0.1 * math.cos(sine / 25), -.6) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2)
2307
					LH.C0 = clerp(LH.C0, cn(-.9, -.9 - 0.1 * math.cos(sine / 25), .5) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2)			
2308
			
2309
2310
		end
2311
end
2312
end
2313
--------------------------------------------------------------------------------------------------------------------------
2314
2315
				function DanAni1()
2316
			for i = 0, .8, 0.05 + MusThingHat.Mesh.Scale.Y*0.025 do
2317
				
2318
		swait()
2319
		RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,-.4) * angles(math.rad(5), math.rad(-8), math.rad(0)), MusThingHat.Mesh.Scale.Y*0.2)
2320
		Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(MusThingHat.Mesh.Scale.Y*30)    +math.rad(-10),0,math.rad(0)),MusThingHat.Mesh.Scale.Y*0.2)
2321
		LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, -.25) * angles(math.rad(170), math.rad(0), math.rad(20)), MusThingHat.Mesh.Scale.Y*0.2)
2322
		RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.0) * angles(math.rad(90), math.rad(0), math.rad(-45)), MusThingHat.Mesh.Scale.Y*0.2)
2323
		RH.C0 = clerp(RH.C0, cn(1, -.2, -.4) * RHCF * angles(math.rad(-4), math.rad(-15), math.rad(-5)), MusThingHat.Mesh.Scale.Y*0.3)
2324
		LH.C0 = clerp(LH.C0, cn(-1, -1, -.0) * LHCF * angles(math.rad(4), math.rad(5), math.rad(5)), MusThingHat.Mesh.Scale.Y*0.2)
2325
		end
2326
			
2327
			end	
2328
2329
2330
2331
				function DanAni2()
2332
			for i = 0, .8, 0.05 + MusThingHat.Mesh.Scale.Y*0.025 do
2333
				
2334
		swait()
2335
		RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,-.5) * angles(math.rad(8), math.rad(8), math.rad(0)), MusThingHat.Mesh.Scale.Y*0.2)
2336
		Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(MusThingHat.Mesh.Scale.Y*30)    +math.rad(-10),0,math.rad(0)),MusThingHat.Mesh.Scale.Y*0.2)
2337
		LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.25) * angles(math.rad(180), math.rad(0), math.rad(25)), MusThingHat.Mesh.Scale.Y*0.2)
2338
		RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.0) * angles(math.rad(0), math.rad(0), math.rad(45)), MusThingHat.Mesh.Scale.Y*0.2)
2339
		RH.C0 = clerp(RH.C0, cn(1, -1, -.0) * RHCF * angles(math.rad(4), math.rad(-5), math.rad(-8)), MusThingHat.Mesh.Scale.Y*0.2)
2340
		LH.C0 = clerp(LH.C0, cn(-1, -.2, -.4) * LHCF * angles(math.rad(-4), math.rad(15), math.rad(8)), MusThingHat.Mesh.Scale.Y*0.3)
2341
		end
2342
		
2343
			
2344
			end	
2345
2346
2347
2348
--------------------------------------------------------------------------------------------------------------------------
2349
2350
BuildNow = false
2351
		
2352
Shotuse	= false	
2353
		
2354
wait2 = false
2355
2356
mouse.KeyDown:connect(function(key)
2357
2358
	if key == "g" and attack == false then
2359
yes:Play()
2360
head.face.Texture = "http://www.roblox.com/asset/?id=393521316"
2361
		humanoid.WalkSpeed = 0
2362
		attack = true 
2363
		Yes1()
2364
		Yes2()
2365
		Yes1()
2366
		Yes2()
2367
		attack = false 
2368
		humanoid.WalkSpeed = 16
2369
		head.face.Texture = "http://www.roblox.com/asset/?id=156600391"
2370
	end
2371
end)
2372
2373
2374
mouse.KeyDown:connect(function(key)
2375
	if key == "e" and attack == false then
2376
if Wep == 1 then
2377
Wep = 2
2378
else 	
2379
Wep = 1		
2380
end		
2381
		
2382
		
2383
	end
2384
	end)
2385
2386
mouse.KeyDown:connect(function(key)
2387
	if key == "p" and attack == false then
2388
	
2389
Wep = 3		
2390
	
2391
		
2392
		
2393
	end
2394
	end)
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
equippedgun = true
2408
2409
2410
2411
2412
coroutine.wrap(function()
2413
while equippedgun do
2414
2415
if spread < 0 then spread = 0 end
2416
if humanoid.Health == 0 then break end
2417
     
2418
2419
game:service'RunService'.Stepped:wait()
2420
end
2421
end)()
2422
	
2423
mouse.Button1Down:connect(function()
2424
if debounce then return end
2425
if equippedgun2 == true and attack == false then
2426
	Shotuse = true
2427
debounce = true
2428
2429
wait(.2)
2430
2431
sound:play()
2432
2433
2434
2435
coroutine.wrap(function()
2436
wait(0.3)
2437
for angle = 0, 4 do
2438
2439
wait()
2440
end
2441
2442
wait(0.2)
2443
sound2:play()
2444
2445
2446
wait(0.1)
2447
for move = 0, 3 do
2448
if move > 2 then return end
2449
2450
2451
wait(0.06)
2452
end
2453
end)()
2454
spread = spread + 1
2455
coroutine.wrap(function()
2456
for bullitz = 0, 7 do
2457
if bullitz > 6 then return end
2458
rayCast2(300, 1, Reaper4)
2459
GunParticle.Enabled = true
2460
            local PointLight = Instance.new("PointLight", Reaper4);
2461
            PointLight.Color = Color3.new(.2,.2,0)
2462
            PointLight.Brightness = 2;
2463
            game:service'Debris':AddItem(PointLight, .05);
2464
end
2465
end)()
2466
coroutine.wrap(function()
2467
for _ = 0, 50 do
2468
pcall(function()
2469
spread = spread - 0.03
2470
end)
2471
wait()
2472
end
2473
end)()
2474
wait(1)
2475
debounce = false
2476
end
2477
2478
end)
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
mouse.Button1Down:connect(function(key)
2489
2490
	if attack == false and Wep == 1 then
2491
attack = true
2492
2493
AttackAnim1()
2494
combo = 1
2495
Swing:Play()
2496
AttackAnim2()
2497
attack = false
2498
combo = 0
2499
	end
2500
end)
2501
2502
2503
2504
mouse.KeyDown:connect(function(key)
2505
2506
	if key == "f" and attack == false then
2507
		No:Play()
2508
		humanoid.WalkSpeed = 0
2509
		attack = true 
2510
		No1()
2511
		No2()
2512
		attack = false 
2513
		humanoid.WalkSpeed = 16
2514
	end
2515
end)
2516
2517
2518
2519
2520
mouse.KeyDown:connect(function(key)
2521
if attack == false or DA == true then
2522
	if key == "r" and Wep == 3 then
2523
2524
if DA == false then
2525
DA = true
2526
RUS:Play()
2527
attack=true
2528
humanoid.WalkSpeed = 0
2529
head.face.Texture = "http://www.roblox.com/asset/?id=393521316"
2530
else
2531
DA = false
2532
RUS:Stop()
2533
attack=false
2534
humanoid.WalkSpeed = 16
2535
head.face.Texture = "http://www.roblox.com/asset/?id=156600391"
2536
end
2537
	end
2538
	end
2539
	end)
2540
2541
2542
2543
mouse.KeyDown:connect(function(key)
2544
2545
	if key == "t" and attack == false then
2546
		Taunt:Play()
2547
		humanoid.WalkSpeed = 0
2548
		attack = true 
2549
		No1()
2550
		Yes2()
2551
		attack = false 
2552
		humanoid.WalkSpeed = 16
2553
	end
2554
end)
2555
2556
mouse.KeyDown:connect(function(key)
2557
	if key == "z" then
2558
		
2559
		
2560
		
2561
	if	NoSentry == false and attack == false and wait2 == false  then
2562
wait2 = true	
2563
	for i,v in pairs(script:children()) do
2564
		if (v:IsA'Model') then
2565
			
2566
			
2567
				for i,v in pairs(v:children()) do
2568
					if (v:IsA'Humanoid') then
2569
					v.Health = 0
2570
				end
2571
			end
2572
			
2573
			
2574
		end
2575
		
2576
	NoSentry = true	
2577
		
2578
	end	
2579
		
2580
		
2581
		
2582
	end
2583
		
2584
		
2585
	
2586
		if NoSentry == true and attack == false and wait2 == false and Wep == 1  then
2587
		attack = true
2588
		 wait2 = true
2589
		humanoid.WalkSpeed = 0
2590
AnimSit()
2591
AnimSitHit1()
2592
WSH = WSHM[math.random(1,#WSHM)]
2593
HitM.SoundId = "rbxassetid://"..WSH
2594
HitM:Play()	
2595
BuildNow = true
2596
AnimSitHit2()		
2597
AnimSitHit1()
2598
WSH = WSHM[math.random(1,#WSHM)]
2599
HitM.SoundId = "rbxassetid://"..WSH
2600
HitM:Play()	
2601
AnimSitHit2()		
2602
AnimSitHit1()
2603
WSH = WSHM[math.random(1,#WSHM)]
2604
HitM.SoundId = "rbxassetid://"..WSH
2605
HitM:Play()	
2606
AnimSitHit2()	
2607
AnimSitHit1()
2608
WSH = WSHM[math.random(1,#WSHM)]
2609
HitM.SoundId = "rbxassetid://"..WSH
2610
HitM:Play()	
2611
AnimSitHit2()
2612
AnimSitHit1()
2613
WSH = WSHM[math.random(1,#WSHM)]
2614
HitM.SoundId = "rbxassetid://"..WSH
2615
HitM:Play()	
2616
AnimSitHit2()
2617
AnimSitHit1()
2618
WSH = WSHM[math.random(1,#WSHM)]
2619
HitM.SoundId = "rbxassetid://"..WSH
2620
HitM:Play()	
2621
AnimSitHit2()	
2622
AnimSitHit1()
2623
WSH = WSHM[math.random(1,#WSHM)]
2624
HitM.SoundId = "rbxassetid://"..WSH
2625
HitM:Play()	
2626
AnimSitHit2()
2627
AnimSitHit1()
2628
WSH = WSHM[math.random(1,#WSHM)]
2629
HitM.SoundId = "rbxassetid://"..WSH
2630
HitM:Play()	
2631
AnimSitHit2()
2632
AnimSitHit1()
2633
WSH = WSHM[math.random(1,#WSHM)]
2634
HitM.SoundId = "rbxassetid://"..WSH
2635
HitM:Play()	
2636
AnimSitHit2()
2637
AnimSitHit1()
2638
WSH = WSHM[math.random(1,#WSHM)]
2639
HitM.SoundId = "rbxassetid://"..WSH
2640
HitM:Play()	
2641
AnimSitHit2()
2642
AnimSit()			
2643
2644
	humanoid.WalkSpeed = 16		
2645
		attack = false
2646
NoSentry = false
2647
2648
		end
2649
		wait()
2650
		
2651
		wait2 = false
2652
end end)
2653
2654
2655
2656
humanoid.Died:connect(function()
2657
	Arms:Destroy()
2658
end)
2659
2660
print([[
2661
	
2662
	
2663
----------------------------------------
2664
Tf2 Engineer Class
2665
----------------------------------------
2666
Script by: 123jl123	
2667
Sentry by: Madiik
2668
TheBoozled gave me a Mesh and Sounds from tf2 
2669
----------------------------------------
2670
Dont leak and dont do it.....
2671
----------------------------------------
2672
]])
2673
2674
game:GetService("RunService"):BindToRenderStep("ew", 0, function()
2675
	MusThingHat.Mesh.Scale = Vector3.new(MusThingHat.Mesh.Scale.X, RUS.PlaybackLoudness / 160, MusThingHat.Mesh.Scale.Z)
2676
end)
2677
2678
	local mesh1anan = Instance.new("SpecialMesh")
2679
	mesh1anan.MeshType = Enum.MeshType.FileMesh
2680
	mesh1anan.Scale = Vector3.new(3,3,3)
2681
mesh1anan.MeshId = "http://www.roblox.com/asset/?id=521754610"
2682
mesh1anan.TextureId = "http://www.roblox.com/asset/?id=521754612"
2683
2684
Glow1 = Color3.new(1,1,1)
2685
Glow2 = Color3.new(0,0,0)
2686
2687
GlowParticle = Instance.new("ParticleEmitter")
2688
GlowParticle.LightEmission = 1
2689
2690
GlowParticle.Size = NumberSequence.new(0,2)
2691
GlowParticle.Texture = "http://www.roblox.com/asset/?id=52620985"
2692
GlowParticle.Transparency = NumberSequence.new(0,1)
2693
GlowParticle.LockedToPart = false
2694
GlowParticle.Lifetime = NumberRange.new(0.5)
2695
GlowParticle.Rate= 25
2696
GlowParticle.Speed =NumberRange.new(0)	
2697
	
2698
	
2699
	function RainDucks()
2700
	        local locationanan = char.Torso.CFrame
2701
	        local tacoa = Instance.new("Part")
2702
	        tacoa.Size = Vector3.new(.5,.5,.5)
2703
	        tacoa.CanCollide = false
2704
	        tacoa.RotVelocity = Vector3.new(math.random(0,6),math.random(0,6),math.random(0,6))
2705
	        local meshanananan = mesh1anan:clone()
2706
	        meshanananan.Parent = tacoa
2707
	        meshanananan.Scale = Vector3.new(1,1,1)
2708
	        tacoa.CFrame = locationanan * CFrame.new(math.random(-8,8),math.random(10,40),math.random(-8,8))
2709
	        tacoa.Parent = workspace
2710
	       
2711
2712
	        game:GetService("Debris"):AddItem(tacoa,4)	
2713
	 local GP = GlowParticle:clone()
2714
    GP.Parent = tacoa
2715
	Glow1 = Color3.new(math.random(), math.random(), math.random())
2716
	GP.Color = ColorSequence.new(Glow1,Glow2)
2717
	
2718
	end
2719
	
2720
	
2721
	
2722
--]]
2723
2724
2725
2726
while true do wait() 
2727
	if BuildNow == true then
2728
	BuildNow = false
2729
2730
BuildSentry()		
2731
	end
2732
	if Shotuse == true then
2733
		Shotuse	= false	
2734
		attack = true 
2735
		ShotAttackAnim1()
2736
		GunParticle.Enabled = false
2737
		ShotAttackAnim2()
2738
		ShotAttackAnim3()
2739
		ShotAttackAnim4()
2740
		ShotAttackAnim3()
2741
		attack = false 
2742
	end
2743
	
2744
	
2745
	
2746
	
2747
if DA == true then
2748
DanAni1()	
2749
	RainDucks()	
2750
            local PointLight = Instance.new("PointLight", Torso);
2751
            PointLight.Color = Color3.new(math.random(), math.random(), math.random())
2752
            PointLight.Brightness = 50;
2753
            PointLight.Range = MusThingHat.Mesh.Scale.Y*10;
2754
            game:service'Debris':AddItem(PointLight, .3);
2755
	
2756
DanAni2()	
2757
	RainDucks()
2758
            local PointLight = Instance.new("PointLight", Torso);
2759
            PointLight.Color = Color3.new(math.random(), math.random(), math.random())
2760
            PointLight.Brightness = 50;
2761
            PointLight.Range = MusThingHat.Mesh.Scale.Y*10;
2762
            game:service'Debris':AddItem(PointLight, .3);
2763
	
2764
2765
	
2766
end	
2767
	
2768
2769
	
2770
	
2771
	
2772
	
2773
end