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