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