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