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