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