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