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