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