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