· 8 years ago · Aug 23, 2018, 07:08 PM
1if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
2local Player,Mouse,mouse,UserInputService,ContextActionService = owner
3do
4 print("FE Compatibility code by Mokiros")
5 script.Parent = Player.Character
6
7 --RemoteEvent for communicating
8 local Event = Instance.new("RemoteEvent")
9 Event.Name = "UserInput_Event"
10
11 --Fake event to make stuff like Mouse.KeyDown work
12 local function fakeEvent()
13 local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
14 t.connect = t.Connect
15 return t
16 end
17
18 --Creating fake input objects with fake variables
19 local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
20 local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
21 local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
22 CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
23 end}
24 --Merged 2 functions into one by checking amount of arguments
25 CAS.UnbindAction = CAS.BindAction
26
27 --This function will trigger the events that have been :Connect()'ed
28 local function te(self,ev,...)
29 local t = m[ev]
30 if t and t._fakeEvent and t.Function then
31 t.Function(...)
32 end
33 end
34 m.TrigEvent = te
35 UIS.TrigEvent = te
36
37 Event.OnServerEvent:Connect(function(plr,io)
38 if plr~=Player then return end
39 if io.isMouse then
40 m.Target = io.Target
41 m.Hit = io.Hit
42 else
43 local b = io.UserInputState == Enum.UserInputState.Begin
44 if io.UserInputType == Enum.UserInputType.MouseButton1 then
45 return m:TrigEvent(b and "Button1Down" or "Button1Up")
46 end
47 for _,t in pairs(CAS.Actions) do
48 for _,k in pairs(t.Keys) do
49 if k==io.KeyCode then
50 t.Function(t.Name,io.UserInputState,io)
51 end
52 end
53 end
54 m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
55 UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
56 end
57 end)
58 Event.Parent = NLS([==[
59 local Player = game:GetService("Players").LocalPlayer
60 local Event = script:WaitForChild("UserInput_Event")
61
62 local UIS = game:GetService("UserInputService")
63 local input = function(io,a)
64 if a then return end
65 --Since InputObject is a client-side instance, we create and pass table instead
66 Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
67 end
68 UIS.InputBegan:Connect(input)
69 UIS.InputEnded:Connect(input)
70
71 local Mouse = Player:GetMouse()
72 local h,t
73 --Give the server mouse data 30 times every second, but only if the values changed
74 --If player is not moving their mouse, client won't fire events
75 while wait(1/30) do
76 if h~=Mouse.Hit or t~=Mouse.Target then
77 h,t=Mouse.Hit,Mouse.Target
78 Event:FireServer({isMouse=true,Target=t,Hit=h})
79 end
80 end]==],Player.Character)
81 Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
82end
83--Knife Module Script
84
85--Perhapz
86
87wait(.2)
88local toool = Instance.new("Tool",game.Players.LocalPlayer.Backpack)
89toool.Name = "QuickScope"
90
91local hndle = Instance.new("Part",toool)
92hndle.Name = "Handle"
93
94local mesh = Instance.new("SpecialMesh",hndle)
95mesh.MeshId = "http://www.roblox.com/asset/?id=121944778"
96mesh.TextureId = "http://www.roblox.com/asset/?id=121944805"
97mesh.Scale = Vector3.new(.7,.7,.7)
98
99local sound = Instance.new("Sound",hndle)
100
101
102script.Parent = toool
103
104
105
106
107local tool=script.Parent
108
109local player=owner
110
111local char=player.Character
112
113local humanoid=char:FindFirstChild("Humanoid")
114
115local camera=workspace.CurrentCamera
116
117local rightC1 = CFrame.new(-0.5, 0.7, 0) * CFrame.Angles(0, (math.pi / 2), 0)
118
119local leftC1 = CFrame.new(0, 0.7, 0) * CFrame.Angles(0, (math.pi / 2), 0)
120
121local equipping=false
122
123local gettingknife=false
124
125local laserCharge=false
126
127local playcharge=false
128
129local justthrown=false
130
131local canLaser=true
132
133local justattacked=false
134
135local thrownkniferotation=0
136
137local Damage=110
138
139local Attacking=false
140
141local handle=nil
142
143local WalkSpeeds={16,20}
144
145local fasterthrow = .2
146
147local knifespeed = 225
148
149
150
151
152
153
154
155--[[if player.Gamepass4.Value == true then
156
157fasterthrow = 0.5
158
159else
160
161fasterthrow = 0.2
162
163end
164
165if player.Gamepass5.Value == true then
166
167knifespeed = 305
168
169else
170
171knifespeed = 225
172
173end
174--]]
175
176
177
178
179
180SOUNDS={
181
182throwing={"153647554","153647549"},
183
184laserthrowing={"193444173"},
185
186shouts={"241084057","224360245","199837759","168209314"},
187
188striking={"153647529","153647534","153647539","153647540"},
189
190equip="153647514",
191
192wallhit={"153647563","153647564"},
193
194hitplayer={"153676325"},
195
196deaths={"241084057","146457047","146594648","168209314"},
197
198}
199
200
201
202SETTINGS={
203
204
205tool={
206
207tool_size=Vector3.new(0.4, 3, 0.7),
208
209tool_transparency=0,
210
211tool_color=BrickColor.Black(),
212
213default_tool_size=0.6,
214
215},
216
217
218}
219
220
221
222function DamageObject(hit)
223
224local char=hit.Parent
225
226if char and char~=player.Character and char.Name~="Arms_Model" and hit.Name~="Handle" then
227
228local h=char:FindFirstChild("Humanoid")
229
230if h and h.Health > 0 then
231
232
233
234h:TakeDamage(Damage)
235
236PlaySound("Hit1",char.Torso)
237
238local explosion = Instance.new("Explosion")
239
240explosion.ExplosionType = 'NoCraters'
241
242explosion.Position = humanoid.Torso.CFrame.p
243
244explosion.BlastPressure=0
245
246explosion.Parent=workspace
247
248if h.Health == 0 then
249
250PlaySound("Hit2")
251
252end
253
254end
255
256end
257
258end
259
260
261
262function PlaySound(name,ctorso)
263
264if name=="Throw" then
265
266tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.throwing[math.random(1,#SOUNDS.throwing)]
267
268tool.Handle.Sound:Play()
269
270elseif name=="ThrowLaser" then
271
272tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.laserthrowing[math.random(1,#SOUNDS.laserthrowing)]
273
274tool.Handle.Sound:Play()
275
276elseif name=="Equip" then
277
278tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.equip
279
280tool.Handle.Sound:Play()
281
282elseif name=="Swing" then
283
284tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.striking[math.random(1,#SOUNDS.striking)]
285
286tool.Handle.Sound:Play()
287
288elseif name=="Hit1" then
289
290local NewSound=tool.Handle.Sound:clone()
291
292NewSound.Parent=ctorso
293
294NewSound.SoundId = "rbxassetid://" .. SOUNDS.hitplayer[math.random(1,#SOUNDS.hitplayer)]
295
296NewSound:Play()
297
298NewSound:Destroy()
299
300--elseif name=="Hit2" then
301
302--local NewSound=tool.Handle.Sound:clone()
303
304--NewSound.Parent=ctorso
305
306--NewSound.SoundId = "rbxassetid://" .. SOUNDS.deaths[math.random(1,#SOUNDS.deaths)]
307
308--NewSound:Play()
309
310-- NewSound:Destroy()
311
312elseif name=="Laser" then
313
314local NewSound=tool.Handle.Sound:Clone()
315
316NewSound.Parent = ctorso
317NewSound.SoundId = "rbxassetid://" .. SOUNDS.shouts[math.random(1,#SOUNDS.shouts)]
318
319NewSound:Play()
320
321
322end
323
324end
325
326
327
328function Throwtool(dPos)
329
330if not tool.Handle then return end
331
332local throwingHandle = tool.Handle:Clone()
333
334game:GetService("Debris"):AddItem(throwingHandle, 5)
335
336throwingHandle.Transparency=0
337
338throwingHandle.Parent = workspace
339
340if player.Character and player.Character.Humanoid then
341
342throwingHandle.Velocity = (player.Character.Humanoid.TargetPoint - throwingHandle.CFrame.p).unit * knifespeed
343
344if canLaser then
345
346throwingHandle.Velocity = (player.Character.Humanoid.TargetPoint - throwingHandle.CFrame.p).unit * 15000
347
348end
349
350if mouse.Target ~= nil then
351
352if mouse.Target.Parent.Name~="Arms_Model" and mouse.Target.Name~="ThrownKnife" and mouse.Target.Name~="Handle" then
353
354targetpos=player.Character.Humanoid.TargetPoint
355
356else
357
358targetpos=Vector3.new(0,-10,0)
359
360end
361
362end
363
364-- set the orientation to the direction it is being thrown in
365
366throwingHandle.CFrame = CFrame.new(throwingHandle.CFrame.p, throwingHandle.CFrame.p + throwingHandle.Velocity) * CFrame.Angles(0, 0, math.rad(-90))
367
368local floatingForce = Instance.new('BodyForce', throwingHandle)
369
370floatingForce.force = Vector3.new(0, 196.2 * throwingHandle:GetMass() * 0.98, 0)
371
372local spin = Instance.new('BodyAngularVelocity', throwingHandle)
373
374spin.angularvelocity = throwingHandle.CFrame:vectorToWorldSpace(Vector3.new(0, -400, 0))
375
376spawnPos=player.Character.PrimaryPart.Position
377
378spawnPos = spawnPos + dPos*5
379
380if canLaser then
381
382local Ray = Ray.new(tool.Handle.CFrame.p,(mouse.Hit.p - tool.Handle.CFrame.p).unit * 999)
383
384 local Hit,Position = game.Workspace:FindPartOnRay(Ray,char)
385
386 if Hit then
387
388 if Hit.Parent:FindFirstChild("Humanoid") then
389
390throwingHandle:Destroy()
391
392 Hit.Parent.Humanoid:TakeDamage(110)
393PlaySound("Laser",Hit.Parent.Torso)
394PlaySound("Hit1",Hit.Parent.Torso)
395laserCharge=true
396
397
398
399local explosion = Instance.new("Explosion")
400
401explosion.Position=Hit.Parent.Torso.Position
402
403explosion.BlastRadius=explosion.BlastRadius*2
404
405explosion.Parent=workspace
406
407end end
408
409 local RayPart = Instance.new("Part",workspace)
410
411RayPart.Name = "RayPart"
412
413RayPart.BrickColor = BrickColor.new("White")
414
415RayPart.Transparency = 0
416
417RayPart.Anchored = true
418
419RayPart.CanCollide = false
420
421RayPart.TopSurface = Enum.SurfaceType.Smooth
422
423RayPart.BottomSurface = Enum.SurfaceType.Smooth
424
425RayPart.formFactor = Enum.FormFactor.Custom
426
427local Distance = (Position-tool.Handle.CFrame.p).magnitude
428
429RayPart.Size = Vector3.new(0.2,0.2,Distance)
430
431RayPart.CFrame = CFrame.new(Position,tool.Handle.CFrame.p) * CFrame.new(0,0,-Distance/2)
432
433game.Debris:addItem(RayPart,.5)
434
435
436end
437
438end
439
440if throwingHandle then
441
442
443
444local touchedConn = throwingHandle.Touched:connect(function(hit)
445
446local char=hit.Parent
447
448camera.CameraSubject=humanoid
449
450camera.CameraType=Enum.CameraType.Custom
451
452if char and char~=player.Character and char.Name~="Arms_Model" and hit.Name~="Handle" and hit.Name~="RayPart" then
453
454local h=char:FindFirstChild("Humanoid")
455
456if h and h.Health > 0 then
457
458throwingHandle:Destroy()
459
460laserCharge=true
461
462if hit.Name~="Head" or hit.className=="Hat" then
463
464h:TakeDamage(Damage)
465
466-- player.Credits.Value = player.Credits.Value + 15
467
468--player.PlayerGui.NormalKillGui.Script.Disabled = false
469
470local explosion = Instance.new("Explosion")
471
472explosion.Position=h.Parent.Torso.Position
473
474explosion.BlastRadius=explosion.BlastRadius*2
475
476explosion.Parent=workspace
477
478
479if h.Health == 0 then
480
481PlaySound("Hit2",char.Torso)
482
483end
484
485else
486
487h:TakeDamage(Damage * 2)
488
489print("Headshot!")
490
491--player.Credits.Value = player.Credits.Value + 50
492
493--player.PlayerGui.HeadShotGui.Script.Disabled = false
494
495local explosion = Instance.new("Explosion")
496
497explosion.Position=h.Parent.Torso.Position
498
499explosion.BlastRadius=explosion.BlastRadius*2
500
501explosion.Parent=workspace
502
503char.Head.Transparency=1
504
505char.Head.CanCollide=false
506
507if char.Head:FindFirstChild("face") then char.Head:FindFirstChild("face").Transparency=1 end
508
509for _,v in pairs(char:GetChildren()) do
510
511if v.className=="Hat" then
512
513v:Destroy()
514
515end
516
517end
518
519for i = 1, 7 do
520
521local blood=Instance.new("Part")
522
523blood.FormFactor="Custom"
524
525blood.Size=Vector3.new(1,.2,1)
526
527blood.BrickColor=BrickColor.Red()
528
529blood.TopSurface=0
530
531blood.BottomSurface=0
532
533game:GetService("Debris"):AddItem(blood,5)
534
535blood.Parent=workspace
536
537blood.Position=char.Head.Position + Vector3.new(math.random(0.2,0.8),0,math.random(0.2,0.8))
538
539end
540
541local sound = Instance.new("Sound")
542
543sound.SoundId = "rbxassetid://142347633"
544
545sound.Parent=char.Head
546
547sound.Pitch=1.1
548
549sound:Play()
550
551end
552
553PlaySound("Hit1",char.Torso)
554
555if h.Health == 0 then
556
557PlaySound("Hit2")
558
559end
560
561elseif hit.Name~="Handle" or hit.Name~="IgnoreThrowingKnives" and hit.Parent.Name~="Arms_Model" and hit.Name~="RayPart" and hit.CanCollide==true then
562
563local sound=Instance.new("Sound")
564
565sound.Parent=hit
566
567sound.SoundId = "rbxassetid://" .. SOUNDS.wallhit[math.random(1,#SOUNDS.wallhit)]
568
569sound:Play()
570
571sound:Destroy()
572
573print("Hit Object: " .. hit.Name)
574
575local newknife=tool.Handle:clone()
576
577newknife.Name="ThrownKnife"
578
579newknife.CFrame = CFrame.new(spawnPos, spawnPos + dPos) * CFrame.Angles(math.pi/-2, 0, 0)
580
581newknife.Position = targetpos
582
583throwingHandle:Destroy()
584
585newknife.Anchored=true
586
587newknife.CanCollide=true
588
589newknife.Transparency=0
590
591newknife.Parent=workspace
592
593--newknife.Script.Disabled = false
594
595wait(7)
596
597for i=1,10 do
598
599newknife.Transparency=i*.1
600
601wait()
602
603end
604
605newknife:Destroy()
606
607end
608
609end
610
611 end)
612
613end
614
615end
616
617-- must check if it still exists since we waited
618
619if throwingHandle then
620
621throwingHandle.CanCollide = true
622
623end
624
625
626
627FUNCTIONS={
628
629
630CHECKFORFIRSTPERSON=function()
631
632if (camera.focus.p - camera.CoordinateFrame.p).magnitude > 1 then
633
634return false
635
636else
637
638return true
639
640end
641
642end,
643
644
645ANIMS=function(state)
646
647if state then
648
649mouse.Icon="http://www.roblox.com/asset/?id=258828417"
650
651--Start Animation
652
653
654
655if SETTINGS.tool then
656
657tool.GripPos = Vector3.new(0, -0.55, 0)
658
659elseif SETTINGS.tool then
660
661tool.GripPos = Vector3.new(0, -0.6, 0)
662
663elseif SETTINGS.tool then
664
665tool.GripPos = Vector3.new(0, -0.65, 0)
666
667elseif SETTINGS.tool then
668
669tool.GripPos = Vector3.new(0, -0.7, 0)
670
671elseif SETTINGS.tool then
672
673tool.GripPos = Vector3.new(0, -0.75, 0)
674
675elseif SETTINGS.tool then
676
677tool.GripPos = Vector3.new(0, -0.8, 0)
678
679elseif SETTINGS.tool then
680
681tool.GripPos = Vector3.new(0, -0.85, 0)
682
683elseif SETTINGS.tool then
684
685tool.GripPos = Vector3.new(0, -0.9, 0)
686
687elseif SETTINGS.tool then
688
689tool.GripPos = Vector3.new(0, -0.95, 0)
690
691elseif SETTINGS.tool then
692
693tool.GripPos = Vector3.new(0, -1, 0)
694
695else
696
697print("Invalid tool size! Set to default: " .. SETTINGS.tool.default_tool_size )
698
699
700if SETTINGS.tool.default_tool_size==.1 then
701
702tool.GripPos = Vector3.new(0, -0.55, 0)
703
704elseif SETTINGS.tool.default_tool_size==.2 then
705
706tool.GripPos = Vector3.new(0, -0.6, 0)
707
708elseif SETTINGS.tool.default_tool_size==.3 then
709
710tool.GripPos = Vector3.new(0, -0.65, 0)
711
712elseif SETTINGS.tool.default_tool_size==.4 then
713
714tool.GripPos = Vector3.new(0, -0.7, 0)
715
716elseif SETTINGS.tool.default_tool_size==.5 then
717
718tool.GripPos = Vector3.new(0, -0.75, 0)
719
720elseif SETTINGS.tool.default_tool_size==.6 then
721
722tool.GripPos = Vector3.new(0, -0.8, 0)
723
724elseif SETTINGS.tool.default_tool_size==.7 then
725
726tool.GripPos = Vector3.new(0, -0.85, 0)
727
728elseif SETTINGS.tool.default_tool_size==.8 then
729
730tool.GripPos = Vector3.new(0, -0.9, 0)
731
732elseif SETTINGS.tool.default_tool_size==.9 then
733
734tool.GripPos = Vector3.new(0, -0.95, 0)
735
736elseif SETTINGS.tool.default_tool_size==1 then
737
738tool.GripPos = Vector3.new(0, -1, 0)
739
740else
741
742print("Invalid default size! Un-equipping and removing Knife...")
743
744
745end
746
747end
748
749torso=char:FindFirstChild("Torso")
750
751leftarm=torso:FindFirstChild("Left Shoulder")
752
753if leftarm then
754
755leftarm.Parent=nil
756
757newarmweld=Instance.new("Weld")
758
759newarmweld.Name="LeftWeld"
760
761newarmweld.Part0=torso
762
763newarmweld.C0 = CFrame.new(-1.5, 0.7, 0)
764
765newarmweld.C1 = CFrame.new(0, 0.7, 0)
766
767newarmweld.Part1=char:FindFirstChild("Left Arm")
768
769newarmweld.Parent=torso
770
771end
772
773humanoid.WalkSpeed=WalkSpeeds[2]
774
775for i = 1, 15, 3 do
776
777if equipped then
778
779torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
780
781torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
782
783end
784
785wait()
786
787end
788
789else
790
791humanoid.WalkSpeed=WalkSpeeds[1]
792
793torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.new(0,-0.2,0)
794
795tool.GripForward = Vector3.new(0,0,-1)
796
797newarmweld:Destroy()
798
799leftarm.Parent=torso
800
801mouse.Icon=""
802
803torso:FindFirstChild("Neck").C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
804
805torso:FindFirstChild("Right Shoulder").C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
806
807end
808
809end
810
811}
812
813
814
815tool.Equipped:connect(function ()
816
817equipped=true
818
819PlaySound("Equip")
820
821FUNCTIONS.ANIMS(true)
822
823end)
824
825tool.Unequipped:connect(function ()
826
827equipped=false
828
829FUNCTIONS.ANIMS(false)
830
831end)
832
833tool.Handle.Touched:connect(function (hit)
834
835if Attacking then
836
837DamageObject(hit)
838
839end
840
841end)
842
843tool.Activated:connect(function ()
844
845if Attacking then return end
846
847if not tool.Enabled then return end
848
849justthrown=false
850
851justattacked=false
852
853if not gettingknife and not justthrown and not Attacking then
854
855HeldTime=time()
856
857end
858
859playcharge=true
860
861wait(.15)
862
863while gettingknife do
864
865wait()
866
867end
868
869local speed=0.2
870
871for i = 1, 15, fasterthrow do
872
873if playcharge and equipped and not gettingknife and not justthrown and not Attacking then
874
875torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, 0.195277825, -0.747909963, 0.634426773, 0.482016951, 0.636551082, 0.602048457, -0.854123056, 0.188237742, 0.484809577) * CFrame.Angles((i * (math.pi / 50)), 0, (-i * (math.pi / 25)))
876
877torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0, 0.858912528, 0.165011853, 0.484809607, -0.464581847, 0.649385393, 0.602048457, -0.215483144, -0.742340684, 0.634426773) * CFrame.Angles((-i * (math.pi / 75)),(i * (math.pi / 180)),0)
878
879player.Character["Right Arm"].RightGrip.C1 = CFrame.new(0, -0.800000012, 0.05, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.Angles((-i * (math.pi / 150)),0,0)
880
881wait()
882
883end
884
885end
886
887if playcharge then
888
889canLaser=true
890
891end
892
893end)
894
895tool.Deactivated:connect(function ()
896
897if not tool.Enabled then return end
898
899currTime=time()
900
901playcharge=false
902
903if HeldTime and currTime - HeldTime > .6 and
904
905currTime - HeldTime > 0.01 and not justthrown and not gettingknife then
906
907if not Attacking and not justattacked then
908
909print("Throw")
910
911if canLaser then
912
913PlaySound("ThrowLaser")
914
915else
916
917PlaySound("Throw")
918
919end
920
921tool.Handle.Transparency=1
922
923local targetPos = player.Character.Humanoid.TargetPoint
924
925local lookAt = (targetPos - player.Character.PrimaryPart.Position).unit
926
927local switchEvenOddParity = 1
928
929local angle = math.ceil((1-1)/2)*math.pi/12*switchEvenOddParity
930
931Throwtool(CFrame.Angles(0, angle, 0) * lookAt)
932
933wait()
934canLaser=true
935
936HeldTime=0
937
938gettingknife=true
939
940mouse.Icon="http://www.roblox.com/asset/?id=258828417"
941
942player.Character["Right Arm"].RightGrip.C1 = CFrame.new(0, -0.800000012, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
943
944for i = 1, 15, .8 do
945
946if equipped then
947
948torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, 0.0719629526, 0.22870943, 0.970831275, -0.981789052, 0.187819958, 0.0285283029, -0.175816804, -0.955204487, 0.238060504) * CFrame.Angles(0, 0, (i * (math.pi / 15)))
949
950torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, 0.7, 0, 0.703028679, -0.151466534, 0.694844246, -0.673604906, 0.171488613, 0.718921423, -0.228050426, -0.973472893, 0.0185328126) * CFrame.Angles((i * (math.pi / 60)),(-i * (math.pi / 180)),(i * (math.pi / 60)))
951
952wait()
953
954end
955
956end
957
958justthrown=true
959
960tool.Handle.Transparency=0
961
962PlaySound("Equip")
963
964mouse.Icon="http://www.roblox.com/asset/?id=258828417"
965
966tool.GripForward = Vector3.new(0,0,-1)
967
968for i = 1, 15, 1 do
969
970if equipped then
971
972torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, -0.071962975, -0.22870943, 0.970831275, 0.981789052, -0.187820047, 0.0285283029, 0.175816894, 0.955204487, 0.238060504) * CFrame.Angles(0, 0, (-i * (math.pi / 30)))
973
974wait()
975
976end
977
978end
979
980gettingknife=false
981
982for i = 1, 15, 3 do
983
984if equipped then
985
986torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
987
988torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
989
990end
991
992wait()
993
994end
995
996end
997
998else
999
1000if not justthrown and not gettingknife then
1001
1002if Attacking then return end
1003
1004print("Attack")
1005
1006HeldTime=0
1007
1008Attacking=true
1009
1010justattacked=true
1011
1012if math.random(1,2)==1 then
1013
1014for i = 1, 15, 3 do
1015
1016if equipped and not gettingknife and not justthrown then
1017
1018torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, 0.195277825, -0.747909963, 0.634426773, 0.482016951, 0.636551082, 0.602048457, -0.854123056, 0.188237742, 0.484809577) * CFrame.Angles((i * (math.pi / 65)), 0, (-i * (math.pi / 30)))
1019
1020torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0, 0.858912528, 0.165011853, 0.484809607, -0.464581847, 0.649385393, 0.602048457, -0.215483144, -0.742340684, 0.634426773) * CFrame.Angles((-i * (math.pi / 75)),(i * (math.pi / 180)),0)
1021
1022wait()
1023
1024end
1025
1026end
1027
1028PlaySound("Swing")
1029
1030for i = 1, 15, 3 do
1031
1032if equipped and not gettingknife and not justthrown then
1033
1034torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, 0.0719629526, 0.22870943, 0.970831275, -0.981789052, 0.187819958, 0.0285283029, -0.175816804, -0.955204487, 0.238060504) * CFrame.Angles(0, 0, (i * (math.pi / 15)))
1035
1036torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, 0.7, 0, 0.703028679, -0.151466534, 0.694844246, -0.673604906, 0.171488613, 0.718921423, -0.228050426, -0.973472893, 0.0185328126) * CFrame.Angles((i * (math.pi / 60)),(-i * (math.pi / 180)),(i * (math.pi / 60)))
1037
1038wait()
1039
1040end
1041
1042end
1043
1044for i = 1, 15, 3 do
1045
1046if equipped and not justthrown and not gettingknife then
1047
1048torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, -0.071962975, -0.22870943, 0.970831275, 0.981789052, -0.187820047, 0.0285283029, 0.175816894, 0.955204487, 0.238060504) * CFrame.Angles(0, 0, (-i * (math.pi / 30)))
1049
1050wait()
1051
1052end
1053
1054end
1055
1056for i = 1, 15, 3 do
1057
1058equipping=true
1059
1060if equipped and not gettingknife and not justthrown then
1061
1062torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
1063
1064torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
1065
1066end
1067
1068wait()
1069
1070end
1071
1072Attacking=false
1073
1074else
1075
1076for i = 1, 15, 3 do
1077
1078if equipped and not gettingknife and not justthrown then
1079
1080torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.3, 0.5, 0, 0.195277825, -0.747909963, 0.634426773, 0.482016951, 0.636551082, 0.602048457, -0.854123056, 0.188237742, 0.484809577) * CFrame.Angles((i * (math.pi / 40)),(-i * (math.pi / 45)),(i * (math.pi / 60)))
1081
1082end
1083
1084wait()
1085
1086end
1087
1088PlaySound("Swing")
1089
1090for i = 1, 15, 3 do
1091
1092if equipped and not gettingknife and not justthrown then
1093
1094torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.2, 0.5, -.3, 0.852928281, -0.428775758, 0.29776603, 0.516928136, 0.614185035, -0.596290231, 0.0727913082, 0.662516415, 0.745502114) * CFrame.Angles((-i * (math.pi / 45)),0,0)
1095
1096torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.200000003, 0.7, 0, 0.849384904, 0.16895318, 0.5, -0.48470962, 0.624545038, 0.612372398, -0.208810255, -0.762494743, 0.612372398) * CFrame.Angles((i * (math.pi / 60)),(-i * (math.pi / 180)),(i * (math.pi / 60)))
1097
1098end
1099
1100wait()
1101
1102end
1103
1104for i = 1, 15, 3 do
1105
1106if equipped and not gettingknife and not justthrown then
1107
1108torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.3, 0.5, -0.300000012, 0.852928281, -0.472260833, -0.222447708, 0.516928136, 0.82349503, 0.233754784, 0.0727913082, -0.314365625, 0.946507096) * CFrame.Angles((i * (math.pi / 45)),0,0)
1109
1110end
1111
1112wait()
1113
1114end
1115
1116for i = 1, 15, 3 do
1117
1118if equipped and not gettingknife and not justthrown then
1119
1120torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
1121
1122torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
1123
1124end
1125
1126wait()
1127
1128end
1129
1130Attacking=false
1131
1132end
1133
1134end
1135
1136end
1137
1138end)
1139
1140
1141
1142mouse.Move:connect(function ()
1143
1144if equipped and mouse then
1145
1146if (mouse.Hit.p - mouse.Origin.p).unit.y < 0.25 and (mouse.Hit.p - mouse.Origin.p).unit.y > -0.25 then
1147
1148torso:FindFirstChild("Right Shoulder").C0 = CFrame.new(.9,.5,0) * CFrame.Angles(0,math.rad(90),0) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))
1149
1150torso:FindFirstChild("LeftWeld").C0 = CFrame.new(-1.5,0.5,0) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))
1151
1152torso:FindFirstChild("Neck").C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),0,math.rad(180)) * CFrame.Angles(math.asin(-(mouse.Hit.p - mouse.Origin.p).unit.y), 0, 0)
1153
1154end
1155
1156end
1157
1158end)