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