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