Rufus14

Katana remake

Aug 27th, 2021 (edited)
1,518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 62.04 KB | None | 0 0
  1. --By Rufus14
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4.     local env = getfenv(func)
  5.     local newenv = setmetatable({},{
  6.         __index = function(self,k)
  7.             if k=="script" then
  8.                 return var
  9.             else
  10.                 return env[k]
  11.             end
  12.         end,
  13.     })
  14.     setfenv(func,newenv)
  15.     return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. Part1 = Instance.new("Part")
  21. SpecialMesh2 = Instance.new("SpecialMesh")
  22. Trail3 = Instance.new("Trail")
  23. RemoteEvent4 = Instance.new("RemoteEvent")
  24. LocalScript5 = Instance.new("LocalScript")
  25. Script6 = Instance.new("Script")
  26. Tool0.Name = "Katana"
  27. Tool0.Parent = mas
  28. Part1.Name = "Handle"
  29. Part1.Parent = Tool0
  30. Part1.CFrame = CFrame.new(-5.07497549, 2.59999967, -14.1249638, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  31. Part1.Orientation = Vector3.new(0, 90, 0)
  32. Part1.Position = Vector3.new(-5.0749754905701, 2.599999666214, -14.124963760376)
  33. Part1.Rotation = Vector3.new(0, 90, 0)
  34. Part1.Size = Vector3.new(0.050000000745058, 5.199999332428, 0.24999992549419)
  35. Part1.BottomSurface = Enum.SurfaceType.Smooth
  36. Part1.TopSurface = Enum.SurfaceType.Smooth
  37. SpecialMesh2.Parent = Part1
  38. SpecialMesh2.MeshId = "rbxassetid://443853663"
  39. SpecialMesh2.Scale = Vector3.new(3, 4.9523801803589, 3.7500004768372)
  40. SpecialMesh2.TextureId = "rbxassetid://443853675"
  41. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  42. Trail3.Name = "trail"
  43. Trail3.Parent = Part1
  44. Trail3.Attachment0 = nil
  45. Trail3.Attachment1 = nil
  46. Trail3.Enabled = false
  47. Trail3.LightInfluence = 1
  48. Trail3.Transparency = NumberSequence.new(0.89999997615814,0.89999997615814)
  49. Trail3.Lifetime = 0.050000000745058
  50. local heit = -1
  51. for i = 1,10 do
  52.     local a = Instance.new("Attachment", Part1)
  53.     a.Name = "hitat"
  54.     if i <= 8 then
  55.         a.Position = Vector3.new(0,heit,0)
  56.         heit = heit + 0.5
  57.     elseif i == 9 then
  58.         a.Position = Vector3.new(0, -1.2, 0)
  59.         a.Name = "trailat1"
  60.         Trail3.Attachment0 = a
  61.     elseif i == 10 then
  62.         a.Position = Vector3.new(0, 2.6, 0)
  63.         a.Name = "trailat2"
  64.         Trail3.Attachment1 = a
  65.     end
  66. end
  67. RemoteEvent4.Parent = Tool0
  68. LocalScript5.Parent = Tool0
  69. table.insert(cors,sandbox(LocalScript5,function()
  70. end))
  71. Script6.Parent = Tool0
  72. table.insert(cors,sandbox(Script6,function()
  73. --By Rufus14, FPS unlocker really recommended to improve hitbox
  74. tool = script.Parent
  75. handle = tool.Handle
  76. trail = handle.trail
  77. players = game:GetService("Players")
  78. runservice = game:GetService("RunService")
  79. tweenservice = game:GetService("TweenService")
  80. player = nil
  81. character = nil
  82. charhum = nil
  83. validatetick = nil
  84. parryfunc = nil
  85. slicefunc = nil
  86. lastswingtick = tick()
  87. lastparrytick = tick()
  88. equiptick = nil
  89. swinganimation = 0
  90. state = "unequipped"
  91. hitpeople = {}
  92. remote = tool.RemoteEvent
  93. cfnew = CFrame.new
  94. cfeuler = CFrame.fromEulerAnglesXYZ
  95. rand = math.random
  96. headoffset = 0
  97. speedbuff = 3
  98. animslowdownmult = 1
  99. bloodpuddlesizemultiplier = 1.8
  100. parrycooldown = 3
  101. bleedingtime = 3
  102. damage = 36
  103. ragdolldespawntime = 10
  104. swingids = {6241709963}
  105. headshotids = {7025209172, 7025209359, 7025209663}
  106. parryids = {7058511334, 7058511852, 7058511971}
  107. decapids = {6425362825}
  108. spinids = {608600954, 608494468}
  109. bloodcolorfromtorso = false
  110. actuallyparied = false
  111. oldplayerws = 16
  112. oldplayerjp = 50
  113. oldplayerhealth = 100
  114.  
  115. function monar(WHAT, duration)
  116.     game:GetService("Debris"):AddItem(WHAT, duration)
  117. end
  118.  
  119. function pose(POSE, KEYFRAME, speeed, btick)
  120.     if state ~= "unequipped" and btick == validatetick then
  121.         pcall(function()
  122.             local findhead = findthing("HeadWeld", character.Torso)
  123.             local findrarm = findthing("RightArmWeld", character.Head)
  124.             local findlarm = findthing("LeftArmWeld", character.Head)
  125.             local findrleg = findthing("RightLegWeld", character.Torso)
  126.             local findlleg = findthing("LeftLegWeld", character.Torso)
  127.             local findrootpart = findthing("HumanoidRootPartWeld", character.HumanoidRootPart)
  128.             local findhandle = findthing("RightGrip", character["Right Arm"])
  129.             local startheadcf = cfnew(0,1.15,0) * cfeuler(-headoffset/1.5,0,0) * cfnew(0,0.35,0)
  130.             if POSE == "equip" then
  131.                 if KEYFRAME == 1 then
  132.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findhead, {C0 = startheadcf})
  133.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findlarm, {C0 = cfnew(-1.44015026, -1.21483612, -0.510011673, 0.939692616, -0.0593911, -0.336824089, -0.219846278, 0.649519145, -0.727868319, 0.262002617, 0.75802207, 0.59729147)})
  134.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findrarm, {C0 = cfnew(1.50723648, -0.872226715, -0.475799561, 0.993774354, -0.0206981599, 0.109471887, 0.105154656, -0.150392503, -0.983018041, 0.0368103981, 0.988409638, -0.147279769)})
  135.                 elseif KEYFRAME == 2 then
  136.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0, findhead, {C0 = startheadcf})
  137.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0, findlarm, {C0 = cfnew(-0.806467056, -1.62165117, -0.794884682, 0.766044438, -0.642787576, 0, 0.413175881, 0.492403835, -0.766044259, 0.492403805, 0.586824, 0.642787635)})
  138.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0, findrarm, {C0 = cfnew(0.806467056, -1.62165117, -0.794883728, 0.766044438, 0.642787576, 1.34110465e-07, -0.413175851, 0.492403924, -0.766044199, -0.492403805, 0.58682394, 0.642787695 )})
  139.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0, findrootpart, {C0 = cfnew()})
  140.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0, findhandle, {C0 = cfnew(-0.0361614227, -1.21160364, -1.67413998, -0.766044438, 0.111618906, 0.63302207, -0.642787576, -0.1330221, -0.754406452, -1.34110451e-07, -0.984807611, 0.17364794)})
  141.                 end
  142.             elseif POSE == "swing" then
  143.                 if KEYFRAME == 1 then
  144.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findhead, {C0 = cfnew(0,1.15,0) * cfeuler(-headoffset/1.5,0,0) * cfnew(-0.0434112549, 0, -0.0751914978, 0.866025388, -0.0868240893, 0.492403865, -7.4505806e-09, 0.98480767, 0.173648149, -0.49999997, -0.150383741, 0.852868438 ) * cfnew(0,0.35,0)})
  145.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findlarm, {C0 = cfnew(1.10525131, -0.346797466, -0.610911369, 0.518183529, -0.848274708, 0.109158911, -0.846994162, -0.491261691, 0.203131348, -0.118685439, -0.19771643, -0.973047614)})
  146.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findrootpart, {C0 = cfnew(0, 0, 0, 0.866025388, -0.0868240893, -0.492403865, 0, 0.98480773, -0.173648179, 0.5, 0.150383726, 0.852868497)})
  147.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findrarm, {C0 = cfnew(1.81095028, -0.792669296, -0.122826576, 0.963875651, -0.228141725, -0.137458891, -0.23417446, -0.971755028, -0.0292248353, -0.126908764, 0.0603585877, -0.990076005)})
  148.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findhandle, {C0 = cfnew(-0.0190238953, -0.549611807, -1.82067871, -0.981861174, 0.00535122305, -0.189525232, 0.18533048, 0.238044456, -0.953408003, 0.0400138423, -0.971239328, -0.234718204)})
  149.                 elseif KEYFRAME == 2 then
  150.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findhead, {C0 = cfnew(0,1.15,0) * cfeuler(-headoffset/1.5,0,0) * cfnew(0, 0, 0, 1, -1.04308143e-07, -1.49011612e-07, 1.0430815e-07, 0.999999821, 1.65765769e-07, 2.08616228e-07, -1.93715067e-07, 0.999999881) * cfnew(0,0.35,0)})
  151.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findlarm, {C0 = cfnew(-0.333414078, -1.1603899, -1.28833961, -0.117892452, -0.802119613, -0.585410416, -0.97422111, -0.0207587872, 0.224636063, -0.192337379, 0.596802056, -0.778994918)})
  152.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findrootpart, {C0 = cfnew(0, 0, 0, 1, 0, 2.98023224e-08, 0, 0.99999994, 0, 2.98023224e-08, -1.49011612e-08, 0.99999994)})
  153.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findrarm, {C0 = cfnew(1.57797241, -1.13960147, -0.93402195, 0.677886784, -0.0921047777, -0.729373753, -0.707186043, 0.189408958, -0.681183755, 0.200890377, 0.977568626, 0.0632626489)})
  154.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findhandle, {C0 = cfnew(0.076672554, -1.0224762, -1.91989994, -0.988381743, 0.0340628475, -0.148095697, 0.147101954, -0.0299755335, -0.988663375, -0.0381166637, -0.998965383, 0.0246175826)})
  155.                 elseif KEYFRAME == 3 then
  156.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findhead, {C0 = cfnew(0,1.15,0) * cfeuler(-headoffset/1.5,0,0) * cfnew(0.0194320679, 0, 0.0230379105, 0.503339767, 0.0388669819, -0.863213837, -0.0593909621, 0.998181283, 0.0103131784, 0.862044811, 0.0460760593, 0.504732668) * cfnew(0,0.35,0)})
  157.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findlarm, {C0 = cfnew(-1.66619301, -1.35887671, 0.900477409, 0.347174168, 0.935889959, -0.0598304197, -0.937460423, 0.34805873, 0.00472488534, 0.025246473, 0.054448206, 0.998196959)})
  158.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findrootpart, {C0 = cfnew(0, 0, 0, 0.503340006, -0.111618757, 0.856848836, -0.0593910962, 0.98480773, 0.163175702, -0.862044871, -0.13302207, 0.489063919)})
  159.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findrarm, {C0 = cfnew(-0.775262833, -1.72180367, -1.46918297, 0.257305473, 0.91981864, 0.296187043, -0.845346093, 0.362754226, -0.392171323, -0.468169838, -0.149472997, 0.870904207)})
  160.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findhandle, {C0 = cfnew(-0.0486164093, -1.80741692, -1.70041466, -0.988385677, -0.0317156464, -0.148615748, 0.147103667, -0.444996178, -0.883367658, -0.0381168537, -0.894970179, 0.444493681)})
  161.                 end
  162.             elseif POSE == "swing2" then
  163.                 if KEYFRAME == 1 then
  164.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findhead, {C0 = cfnew(0,1.15,0) * cfeuler(-headoffset/1.5,0,0) * cfnew(0, 0, 0, 0.499999881, -1.93715096e-07, -0.866025388, -1.49011612e-08, 0.999999821, -2.08499841e-07, 0.866025388, 1.04308128e-07, 0.499999821) * cfnew(0,0.35,0)})
  165.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findlarm, {C0 = cfnew(-1.26632309, -1.35090113, 1.35695839, -0.043412149, 0.829598188, 0.556670249, -0.413175851, 0.492403537, -0.766044378, -0.909615695, -0.263258487, 0.321393788)})
  166.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findrootpart, {C0 = cfnew(0, 0, 0, 0.49999997, -0.150383741, 0.852868557, 0, 0.98480773, 0.173648179, -0.866025448, -0.0868240818, 0.492403835)})
  167.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findrarm, {C0 = cfnew(-0.190731049, -1.41545725, -1.84366465, -0.313556612, 0.859663248, 0.403312594, 0.936659455, 0.210210949, 0.280142605, 0.156047612, 0.465607256, -0.871125042)})
  168.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findhandle, {C0 = cfnew(0.0359020233, -1.18655944, -1.69773293, -0.99903971, 0.0379881859, -0.0215185583, 0.0147992102, -0.169099867, -0.985478938, -0.0410740413, -0.984856904, 0.16837585)})
  169.                 elseif KEYFRAME == 2 then
  170.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findhead, {C0 = cfnew(0,1.15,0) * cfeuler(-headoffset/1.5,0,0) * cfnew(-1.90734863e-06, 0, 0, 0.98480767, -1.94675067e-07, -0.173648372, 1.59529648e-07, 0.999999821, -1.30153737e-07, 0.173648268, 9.32407218e-08, 0.98480767) * cfnew(0,0.35,0)})
  171.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findlarm, {C0 = cfnew(-1.85346794, -1.35090137, -0.0978221893, 0.668901265, 0.734923184, 0.111618809, -0.413175821, 0.492403537, -0.766044259, -0.617945373, 0.466289818, 0.63302207)})
  172.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findrootpart, {C0 = cfnew(0, 0, 0, 0.98480773, 1.49011612e-08, 0.173648357, -1.95160688e-08, 0.99999994, 2.32583446e-08, -0.173648417, -2.23517418e-08, 0.98480773)})
  173.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findrarm, {C0 = cfnew(1.62541008, -0.550931454, -1.00405025, -0.500828028, -0.225280374, 0.835714996, 0.801650107, -0.484819978, 0.349722683, 0.326385826, 0.845102489, 0.423407525)})
  174.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findhandle, {C0 = cfnew(0.0359020233, -1.18655944, -1.69773293, -0.99903971, 0.0379881859, -0.0215185583, 0.0147992102, -0.169099867, -0.985478938, -0.0410740413, -0.984856904, 0.16837585)})
  175.                 elseif KEYFRAME == 3 then
  176.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findhead, {C0 = cfnew(0,1.15,0) * cfeuler(-headoffset/1.5,0,0) * cfnew(-0.0184164047, 0, -0.0394973755, 0.906307757, -0.0368337184, 0.421010077, 2.04890966e-07, 0.996194601, 0.0871555358, -0.42261827, -0.0789896399, 0.902859092) * cfnew(0,0.35,0)})
  177.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findlarm, {C0 = cfnew(-1.3277626, -1.3879056, -1.36363697, 0.962377727, 0.00575536489, -0.271653891, -0.232926458, 0.532265604, -0.813902915, 0.139907792, 0.846557558, 0.513581514 )})
  178.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findrootpart, {C0 = cfnew(0, 0, 0, 0.866025448, -0.0435778536, -0.49809736, 5.32907052e-15, 0.996194661, -0.0871556997, 0.5, 0.0754790604, 0.862729967)})
  179.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findrarm, {C0 = cfnew(1.8669529, -0.645955563, 0.99232769, -0.597461581, -0.717176378, -0.358744264, 0.800334334, -0.505381048, -0.322574556, 0.050040368, -0.479841352, 0.875927091)})
  180.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findhandle, {C0 = cfnew(0.0359020233, -1.18655944, -1.69773293, -0.99903971, 0.0379881859, -0.0215185583, 0.0147992102, -0.169099867, -0.985478938, -0.0410740413, -0.984856904, 0.16837585)})
  181.                 elseif KEYFRAME == 4 then
  182.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0, findhead, {C0 = cfnew(0,1.15,0) * cfeuler(-headoffset/1.5,0,0) * cfnew(-0.0184164047, 0, -0.0394954681, 0.906307697, -0.036833711, 0.421010017, 2.05246465e-07, 0.996194661, 0.0871555358, -0.42261827, -0.0789896473, 0.902858973) * cfnew(0,0.35,0)})
  183.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0, findlarm, {C0 = cfnew(-1.32776451, -1.3879056, -1.36363792, 0.962377548, 0.0057553798, -0.271653861, -0.232926458, 0.532265663, -0.813903034, 0.139907733, 0.846557438, 0.513581395)})
  184.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0, findrootpart, {C0 = cfnew(0, 0, 0, 0.939692616, 3.7252903e-09, -0.342020184, 8.53839044e-09, 1, 3.93331376e-08, 0.342020154, -2.98023224e-08, 0.939692616) * cfeuler(0.1,-0.4,0)})
  185.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0, findrarm, {C0 = cfnew(1.66443443, -1.47913337, 0.946339607, 0.24478662, -0.60071516, -0.761065364, 0.873036921, 0.478010893, -0.0964972153, 0.42176491, -0.640816987, 0.641457379)})
  186.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0, findhandle, {C0 = cfnew(0.0359020233, -1.18655944, -1.69773293, -0.99903971, 0.0379881859, -0.0215185583, 0.0147992102, -0.169099867, -0.985478938, -0.0410740413, -0.984856904, 0.16837585)})
  187.                 end
  188.             elseif POSE == "swing3" then
  189.                 if KEYFRAME == 1 then
  190.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findhead, {C0 = cfnew(0,1.15,0) * cfeuler(-headoffset/1.5,0,0) * cfnew(-9.53674316e-07, 0, 0, 1, 8.44011083e-10, -1.21071935e-08, 8.44011083e-10, 0.99999994, 0, -1.21071935e-08, 0, 1) * cfnew(0,0.35,0)})
  191.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findlarm, {C0 = cfnew(-0.876605034, -0.68309474, -0.88924408, 0.824110806, -0.556670368, -0.104687028, -0.363025188, -0.377203643, -0.852015138, 0.434803277, 0.740159035, -0.512943029)})
  192.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findrootpart, {C0 = cfnew(0, 0, 0, 0.999619842, 0.0271295328, 0.00487130741, -0.0275630038, 0.984844267, 0.171235546, -0.000151902437, -0.171304792, 0.985218048) * cfeuler(0,-math.pi/2,0)})
  193.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findrarm, {C0 = cfnew(0.876605988, -0.68309474, -0.889242172, 0.824110806, 0.556670308, 0.104687028, 0.363025099, -0.377203435, -0.852015316, -0.434803486, 0.740159214, -0.512942791)})
  194.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findhandle, {C0 = cfnew(0.0889234543, -1.26559258, -1.66704273, -0.794784725, 0.295260459, 0.530224919, -0.589384019, -0.16718325, -0.790364504, -0.144718692, -0.940675676, 0.306896657)})
  195.                 elseif KEYFRAME == 2 then
  196.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findhead, {C0 = cfnew(0,1.15,0) * cfeuler(-headoffset/1.5,0,0) * cfnew(0,0.35,0)})
  197.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findrootpart, {C0 = cfnew(0, 0, 0, -0.999992967, -0.00218574586, -0.00302373013, -0.00259801745, 0.989592612, 0.143872872, 0.00267777848, 0.143879741, -0.989591479)})
  198.                 elseif KEYFRAME == 3 then
  199.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findhead, {C0 = cfnew(0,1.15,0) * cfeuler(-headoffset/1.5,0,0) * cfnew(0,0.35,0)})
  200.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findrootpart, {C0 = cfnew(0, 0, 0, -0.00269090617, -0.176192135, 0.984351993, 0.00505291298, 0.984340549, 0.176203862, -0.999983549, 0.00544799771, -0.00175847043)})
  201.                 elseif KEYFRAME == 4 then
  202.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findhead, {C0 = cfnew(0,1.15,0) * cfeuler(-headoffset/1.5,0,0) * cfnew(0, 0, 0, 0.98480767, 3.7252903e-09, 0.173648149, -3.46973899e-08, 0.99999994, 2.08616257e-07, -0.173648149, -1.78813934e-07, 0.984807551) * cfnew(0,0.35,0)})
  203.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findrootpart, {C0 = cfnew(0, 0, 0, 0.999992847, -0.00301244156, 0.00220119907, 0.00259798742, 0.985669076, 0.16866897, -0.00267774635, -0.168662101, 0.985670209)})
  204.                 elseif KEYFRAME == 5 then
  205.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findhead, {C0 = cfnew(0,1.15,0) * cfeuler(-headoffset/1.5,0,0) * cfnew(0, 0, 0, 0.766044617, 1.51420721e-07, 0.642787516, -5.98007404e-08, 1, -1.64301071e-07, -0.642787516, 8.74227624e-08, 0.766044617) * cfnew(0,0.35,0)})
  206.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findlarm, {C0 = cfnew(0.0016746521, -0.961540222, -1.22285843, 0.0597488321, -0.980557978, -0.186909884, -0.995255589, -0.0729201585, 0.0644006208, -0.076778017, 0.18217501, -0.98026371)})
  207.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findrootpart, {C0 = cfnew(0, 0, 0, 0.499999702, 0, -0.866025627, 0, 1, 0, 0.866025627, 0, 0.499999702)})
  208.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findrarm, {C0 = cfnew(2.0153923, -0.72571063, 0.879398346, -0.0795951486, -0.993162811, -0.0853892565, 0.991188586, -0.0879518017, 0.0990364254, -0.105869673, -0.0767543465, 0.991413116)})
  209.                     tween(speeed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findhandle, {C0 = cfnew(0.413618088, -1.95290947, -1.42747879, -0.955172837, 0.258495659, -0.144297406, -0.0294617563, -0.56799978, -0.822499931, -0.294573754, -0.7813797, 0.550155461)})
  210.                 end
  211.             elseif POSE == "parry" then
  212.                 if KEYFRAME == 1 then
  213.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findhead, {C0 = cfnew(-2.86102295e-06, 1.49998641, -1.90734863e-06, 0.342018098, -1.65216625e-06, 0.939690888, -7.4505806e-09, 0.999991, -1.77635229e-06, -0.939686537, -5.99771738e-07, 0.342019409)})
  214.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findlarm, {C0 = cfnew(0.901594162, -1.32347822, -0.197136879, 0.143755198, -0.0773586929, 0.986578584, 0.882555306, -0.440967113, -0.163174614, 0.447674662, 0.894181073, 0.00488291308)})
  215.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findrootpart, {C0 = cfnew(-0.0118789673, -0.203036547, -0.0326347351, 0.336822152, -0.0593906455, -0.939686477, 0.173646167, 0.98479867, -3.4137355e-07, 0.925415277, -0.163176209, 0.342019528)})
  216.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findrarm, {C0 = cfnew(1.0626297, -1.06209946, -0.0650787354, 0.173646837, 1.99768692e-07, 0.984801412, 0.969837129, -0.173648328, -0.171008199, 0.171008036, 0.98480612, -0.0301532429)})
  217.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findhandle, {C0 = cfnew(-0.00456058979, -2.48153496, -0.0186843872, -0.955164194, 0.030058451, -0.294546902, -0.0294590909, -0.999545097, -0.00647266675, -0.29460746, 0.00249462551, 0.955615103)})
  218.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findrleg, {C0 = cfnew(0.872175694, -2.11068511, 3.81469727e-06, 0.939689875, -0.342020959, 1.40070915e-06, 0.342015445, 0.939684629, -6.03497028e-07, 1.10268593e-06, -1.04308128e-06, 0.99999404)})
  219.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findlleg, {C0 = cfnew(-1.05737257, -1.62676859, -0.219942093, 0.940149069, 0.339419574, 0.030154705, -0.339420617, 0.924949646, 0.171007872, 0.0301550031, -0.171009108, 0.984801829)})
  220.                 elseif KEYFRAME == 2 then
  221.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findhead, {C0 = cfnew(0, 1.40954661, 0.28676796, 1, -5.39914254e-07, -4.47039042e-07, 1.85861694e-07, 0.819152832, -0.573575437, 6.75874787e-07, 0.573575377, 0.819152832)})
  222.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findlarm, {C0 = cfnew(-0.429336548, -1.00871325, -1.33772755, 0.984801352, -0.172986597, 0.0151341371, 0.0151344296, -0.00131911295, -0.999875188, 0.172987774, 0.984921634, 0.00131988712)})
  223.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findrootpart, {C0 = cfnew(0, -0.617840767, -0.494980812, 0.999993563, 6.19543812e-08, 2.25289909e-07, 1.7997111e-07, 0.819144428, 0.573571026, 1.49011044e-07, -0.57357651, 0.819150507)})
  224.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findrarm, {C0 = cfnew(0.389614105, -1.01415372, -1.39992189, 0.965919554, 0.257832646, -0.0225576032, -0.0225570872, -0.00295865815, -0.999731779, -0.25783366, 0.966183484, 0.00295909657)})
  225.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findhandle, {C0 = cfnew(0.187524796, -2.42712927, -0.0307271481, -0.960426033, 0.271946609, 0.0602244027, -0.27195397, -0.962275028, 0.00823253393, 0.0601912513, -0.00847152341, 0.998150945)})
  226.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findrleg, {C0 = cfnew(0.499992371, -2.13795662, 0.419466019, 1, 5.65172051e-08, -6.98682413e-07, 1.85861694e-07, 0.9396891, 0.342029929, 6.75874787e-07, -0.342029929, 0.9396891)})
  227.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findlleg, {C0 = cfnew(-0.499990463, -0.670339346, -1.34637785, 1, -6.78257038e-07, -1.76970985e-07, 1.85861694e-07, 0.499993026, -0.866029501, 6.75874787e-07, 0.866029501, 0.499992996)})
  228.                 elseif KEYFRAME == 3 then
  229.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findhead, {C0 = cfnew(0, 1.49808466, 0.0435743332, 0.999993563, 1.51361462e-07, 1.77998857e-07, 1.35271748e-07, 0.996185958, -0.0871579498, 1.90513617e-07, 0.0871537328, 0.996192634)})
  230.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findlarm, {C0 = cfnew(-1.44930458, -0.834447384, -0.797714233, 0.941139936, 0.337688953, 0.0144438297, 0.0715859234, -0.157381371, -0.984930634, -0.330331385, 0.92800492, -0.172290504)})
  231.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findrootpart, {C0 = cfnew(0, 0.110053539, -0.00343513489, 0.999993563, 1.35271748e-07, 1.90513617e-07, 1.7997111e-07, 0.965916872, 0.25881663, 1.49011044e-07, -0.25881961, 0.965924263)})
  232.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findrarm, {C0 = cfnew(-0.362801552, -1.00685477, -1.16335297, -0.0252703037, 0.862672448, -0.505131364, 0.975723982, 0.131241634, 0.175324127, 0.217541575, -0.488438249, -0.84504658)})
  233.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findhandle, {C0 = cfnew(0.0678982735, -1.63876772, -1.6992836, -0.960412204, 0.0364360884, 0.276190013, -0.272002608, -0.336854935, -0.901411951, 0.0601920374, -0.940851271, 0.33343032)})
  234.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findrleg, {C0 = cfnew(0.499990463, -2.13794041, 0.419459343, 1, -1.85854347e-07, -6.7587689e-07, 4.05815683e-07, 0.939688921, 0.342030555, 5.71546025e-07, -0.342030525, 0.939688921)})
  235.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, findlleg, {C0 = cfnew(-0.499990463, -1.82915878, -1.20715046, 1, -6.37221092e-07, -2.92062737e-07, 4.05815683e-07, 0.866023302, -0.500003815, 5.71546025e-07, 0.500003815, 0.866023302)})
  236.                 elseif KEYFRAME == 4 then
  237.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findhead, {C0 = cfnew(0.0613927841, 1.49586678, -0.0182418823, 0.707104743, 0.122787073, -0.696359098, -0.061628405, 0.991752684, 0.112293229, 0.70441556, -0.0364881307, 0.708845139)})
  238.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findlarm, {C0 = cfnew(-1.45631075, -1.61514974, 0.858612061, -0.159541398, 0.823127031, 0.54498136, 0.316107392, 0.565577507, -0.761694908, -0.935206056, 0.0507521033, -0.350429177)})
  239.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findrootpart, {C0 = cfnew(0, 0.010434866, 0.00528049469, 0.866522372, 0.0320669971, -0.498094201, -0.0436544456, 0.998969615, -0.0116322422, 0.49721542, 0.0318230875, 0.867041707)})
  240.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findrarm, {C0 = cfnew(1.27984476, -1.29986334, -1.68792152, 0.702379942, -0.36221078, 0.612749696, 0.711705089, 0.371021271, -0.596489966, -0.0112873912, 0.855062604, 0.518389583)})
  241.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findhandle, {C0 = cfnew(0.510777473, -2.92113781, -0.426809311, -0.960421741, 0.2573888, 0.106494546, -0.271978766, -0.949076772, -0.158999994, 0.0601466894, -0.181671321, 0.981518209)})
  242.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findrleg, {C0 = cfnew(0.761685371, -1.95332146, -0.144449234, 0.984808087, -0.17298606, 0.015127738, 0.173646256, 0.981060505, -0.085832946, 6.67582299e-06, 0.0871558487, 0.99619472)})
  243.                     tween(speeed, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0, findlleg, {C0 = cfnew(-0.670157433, -1.95244908, 0.142192841, 0.995965123, 0.0780069456, 0.0443671234, -0.0844863355, 0.981733739, 0.170472875, -0.0302586295, -0.17353344, 0.984363079)})
  244.                 end
  245.             elseif POSE == "r6stance" then
  246.                 if KEYFRAME == 1 then
  247.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findhead, {C0 = startheadcf})
  248.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findlarm, {C0 = cfnew(-0.806467056, -1.62165117, -0.794884682, 0.766044438, -0.642787576, 0, 0.413175881, 0.492403835, -0.766044259, 0.492403805, 0.586824, 0.642787635)})
  249.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findrarm, {C0 = cfnew(0.806467056, -1.62165117, -0.794883728, 0.766044438, 0.642787576, 1.34110465e-07, -0.413175851, 0.492403924, -0.766044199, -0.492403805, 0.58682394, 0.642787695 )})
  250.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findrootpart, {C0 = cfnew()})
  251.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findhandle, {C0 = cfnew(-0.0361614227, -1.21160364, -1.67413998, -0.766044438, 0.111618906, 0.63302207, -0.642787576, -0.1330221, -0.754406452, -1.34110451e-07, -0.984807611, 0.17364794)})
  252.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findrleg, {C0 = cfnew(0.5,-2,0)})
  253.                     tween(speeed, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0, findlleg, {C0 = cfnew(-0.5,-2,0)})
  254.                 end
  255.             end
  256.         end)
  257.     end
  258. end
  259.  
  260. function tooltransparency(transparency)
  261.     table.foreach(tool:GetDescendants(), function(_, XD) if XD:IsA("BasePart") then XD.Transparency = transparency end end)
  262. end
  263. function searchfornearesthead(maxrange)
  264.     local closestdistance = maxrange
  265.     local guyhead
  266.     for i,v in pairs(workspace:GetDescendants()) do
  267.         local hhhh = v:FindFirstChildOfClass("Humanoid")
  268.         if hhhh and v ~= character then
  269.             if hhhh.Health > 0 then
  270.                 local foundhead = v:FindFirstChild("Head")
  271.                 if foundhead then
  272.                     local mag = (foundhead.Position - character.Head.Position).magnitude
  273.                     if mag < closestdistance then
  274.                         closestdistance = mag
  275.                         guyhead = foundhead
  276.                     end
  277.                 end
  278.             end
  279.         end
  280.     end
  281.     return guyhead, closestdistance
  282. end
  283. function weldlimb(part0, part1, startc0, name)
  284.     local a = Instance.new("Weld", part0)
  285.     a.Part0 = part0
  286.     a.Part1 = part1
  287.     a.C0 = startc0
  288.     a.Name = name
  289. end
  290. function playsound(id, volume, speed, debris, timeposition, parent)
  291.     pcall(function() --pcalling sounds because void has trash sound limit that breaks scripts if you dont do that
  292.         local s = Instance.new("Sound")
  293.         if parent ~= nil then
  294.             s.Parent = parent
  295.         else
  296.             s.Parent = handle
  297.         end
  298.         s.SoundId = "rbxassetid://"..tostring(id)
  299.         s.Volume = volume
  300.         s.PlaybackSpeed = speed
  301.         s.TimePosition = timeposition
  302.         s:Play()
  303.         monar(s, debris)
  304.     end)
  305. end
  306. function playswingid()
  307.     local rand = math.random(1,#swingids)
  308.     playsound(swingids[rand], 1.5, 1.5+math.random(-10,10)/70, 4, 0)
  309. end
  310. function playheadshotid()
  311.     local rand = math.random(1,#headshotids)
  312.     playsound(headshotids[rand], 1, 1+math.random(-10,10)/70, 4, 0.2)
  313. end
  314. function playspinid()
  315.     local rand = math.random(1,#spinids)
  316.     playsound(spinids[rand], 0.5, 1+math.random(-10,10)/70, 4, 0)
  317. end
  318. function playparryid()
  319.     local rand = math.random(1,#parryids)
  320.     playsound(parryids[rand], 0.5, 1+math.random(-10,10)/70, 4, 0)
  321. end
  322. function tween(speed, easingstyle, easingdirection, loopcount, reverseafterfinish, delaytime, WHAT, goal)
  323.     local info = TweenInfo.new(speed, easingstyle, easingdirection, loopcount, reverseafterfinish, delaytime)
  324.     local goals = goal
  325.     local anim = tweenservice:Create(WHAT, info, goals)
  326.     anim:Play()
  327. end
  328. function findthing(WHAT, parent)
  329.     local thing = parent:FindFirstChild(WHAT, true)
  330.     if thing then
  331.         return thing
  332.     else return nil end
  333. end
  334. function push(WHAT, force, debris)
  335.     local v = Instance.new("BodyVelocity", WHAT)
  336.     v.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  337.     v.Velocity = (WHAT.Position - character.Head.Position).unit*force
  338.     monar(v, debris)
  339. end
  340. function makeballconnections(limb, attachementone, attachmenttwo, twistlower, twistupper, du)
  341.     local connection = Instance.new('BallSocketConstraint', limb)
  342.     local bone = Instance.new("Part", limb)
  343.     connection.LimitsEnabled = true
  344.     connection.Attachment0 = attachementone
  345.     connection.Attachment1 = attachmenttwo
  346.     connection.TwistLimitsEnabled = true
  347.     connection.TwistLowerAngle = twistlower
  348.     connection.TwistUpperAngle = twistupper
  349.     bone:BreakJoints()
  350.     local bonew = Instance.new("Weld", bone)
  351.     bonew.Part0 = limb
  352.     bonew.Part1 = bone
  353.     bonew.C0 = cfeuler(0,0,math.pi/2) * cfnew(-limb.Size.y/4.5,0,0)
  354.     if limb.Parent:FindFirstChildOfClass("Humanoid").RigType == Enum.HumanoidRigType.R6 then
  355.         bone.Size = Vector3.new(limb.Size.y/1.8,limb.Size.z,limb.Size.x)
  356.     else
  357.         bone.Size = Vector3.new(limb.Size.y/3,limb.Size.z,limb.Size.x)
  358.     end
  359.     bone.Transparency = 1
  360.     bone.Shape = "Cylinder"
  361.     local noc = Instance.new("NoCollisionConstraint", bone)
  362.     noc.Part0 = attachementone.Parent
  363.     noc.Part1 = attachmenttwo.Parent
  364.     monar(bone, du)
  365.     monar(connection, du)
  366. end
  367. function makehingeconnections(limb, attachementone, attachmenttwo, lower, upper, du)
  368.     local connection = Instance.new('HingeConstraint', limb)
  369.     local bone = Instance.new("Part", limb)
  370.     connection.LimitsEnabled = true
  371.     connection.Attachment0 = attachementone
  372.     connection.Attachment1 = attachmenttwo
  373.     connection.LimitsEnabled = true
  374.     connection.LowerAngle = lower
  375.     connection.UpperAngle = upper
  376.     bone:BreakJoints()
  377.     local bonew = Instance.new("Weld", bone)
  378.     bonew.Part0 = limb
  379.     bonew.Part1 = bone
  380.     bonew.C0 = cfeuler(0,0,math.pi/2) * cfnew(-limb.Size.y/4.5,0,0)
  381.     if limb.Parent:FindFirstChildOfClass("Humanoid").RigType == Enum.HumanoidRigType.R6 then
  382.         bone.Size = Vector3.new(limb.Size.y/1.8,limb.Size.z,limb.Size.x)
  383.     elseif limb.Parent:FindFirstChildOfClass("Humanoid").RigType == Enum.HumanoidRigType.R15 then
  384.         bone.Size = Vector3.new(limb.Size.y/3,limb.Size.z,limb.Size.x)
  385.     elseif limb.Name == "Head" then
  386.         bone.Size = Vector3.new(limb.Size.y/5,limb.Size.z,limb.Size.x)
  387.     end
  388.     bone.Transparency = 1
  389.     bone.Shape = "Cylinder"
  390.     local noc = Instance.new("NoCollisionConstraint", bone)
  391.     noc.Part0 = attachementone.Parent
  392.     noc.Part1 = attachmenttwo.Parent
  393.     monar(bone, du)
  394.     monar(connection, du)
  395. end
  396. function headshotdeath(ch)
  397.     local ched = ch:FindFirstChild("Head")
  398.     if ched then
  399.         Instance.new("BoolValue", ch).Name = "diedbydecapitation"
  400.         local soundpart = Instance.new("Part", workspace)
  401.         soundpart.Anchored = true
  402.         soundpart.Size = Vector3.new()
  403.         soundpart.CanCollide = false
  404.         soundpart.CFrame = ched.CFrame
  405.         soundpart.Transparency = 1
  406.         playsound("4307125957", 1, 1+math.random(-10,10)/70, 2, 0.05)
  407.         playsound("4086201929", 1, 1+math.random(-10,10)/70, 3, 0, soundpart)
  408.         playsound("4086193139", 0.5, 1+math.random(-10,10)/70, 5, 0, soundpart)
  409.         monar(soundpart, 6)
  410.     end
  411. end
  412. function makeragdolllimbr6(limb, dudetorso, at1pos, at2pos, lowt, upt, duratio)
  413.     local at1 = Instance.new("Attachment", dudetorso)
  414.     local at2 = Instance.new("Attachment", limb)
  415.     at1.Position = at1pos
  416.     at2.Position = at2pos
  417.     makeballconnections(limb, at1, at2, lowt, upt, duratio)
  418.     game.Debris:AddItem(at1, duratio)
  419.     game.Debris:AddItem(at2, duratio)
  420. end
  421. function ragdollify(ch, duration, dea)
  422.     local chum = ch:FindFirstChildOfClass("Humanoid")
  423.     if chum then
  424.         if not chum.PlatformStand then
  425.             chum.PlatformStand = true
  426.             if dea then
  427.                 chum.RequiresNeck = false
  428.                 chum.Health = 0
  429.                 local hpsc = ch:FindFirstChild("Health")
  430.                 if hpsc then
  431.                     if hpsc:IsA("Script") then
  432.                         hpsc.Disabled = true
  433.                     end
  434.                 end
  435.                 if ch:FindFirstChild("HumanoidRootPart") then
  436.                     ch:FindFirstChild("HumanoidRootPart"):Destroy()
  437.                 end
  438.                 push(ch.Head, 10, 0.3)
  439.                 monar(ch, ragdolldespawntime)
  440.             elseif ch:FindFirstChild("HumanoidRootPart") then
  441.                 if ch:FindFirstChild("HumanoidRootPart").CanCollide then
  442.                     ch:FindFirstChild("HumanoidRootPart").CanCollide = false
  443.                     coroutine.wrap(function()
  444.                         task.wait(duration)
  445.                         if ch:FindFirstChild("HumanoidRootPart") then
  446.                             ch:FindFirstChild("HumanoidRootPart").CanCollide = true
  447.                         end
  448.                     end)()
  449.                 end
  450.             end
  451.             local savedglue = {}
  452.             local mainpart
  453.             if chum.RigType == Enum.HumanoidRigType.R6 then
  454.                 local chtor = ch.Torso
  455.                 mainpart = chtor
  456.                 if not dea then
  457.                     for i,v in pairs(chtor:GetChildren()) do
  458.                         if v:IsA("Motor6D") then
  459.                             if v.Part1.Name ~= "Head" and v.Part0.Name ~= "HumanoidRootPart" then
  460.                                 table.insert(savedglue, {v, v.Part0, v.Part1})
  461.                                 v.Part1 = nil
  462.                                 v.Part0 = nil
  463.                             end
  464.                         end
  465.                     end
  466.                 end
  467.                 pcall(function()
  468.                     makeragdolllimbr6(ch["Right Arm"], ch.Torso, Vector3.new((ch.Torso.Size.x/2) + (ch.Torso.Size.x/4), (ch.Torso.Size.y/4), 0), Vector3.new(0,ch["Right Arm"].Size.y/4,0), -180, 180, duration)
  469.                 end)
  470.                 pcall(function()
  471.                     makeragdolllimbr6(ch["Left Arm"], ch.Torso, Vector3.new(-(ch.Torso.Size.x/2) - (ch.Torso.Size.x/4), (ch.Torso.Size.y/4), 0), Vector3.new(0,ch["Left Arm"].Size.y/4,0), -180, 180, duration)
  472.                 end)
  473.                 pcall(function()
  474.                     makeragdolllimbr6(ch["Left Leg"], ch.Torso, Vector3.new(-(ch.Torso.Size.x/4), -(ch.Torso.Size.y/2), 0), Vector3.new(0,ch["Left Leg"].Size.y/2,0), -80, 80, duration)
  475.                 end)
  476.                 pcall(function()
  477.                     makeragdolllimbr6(ch["Right Leg"], ch.Torso, Vector3.new((ch.Torso.Size.x/4), -(ch.Torso.Size.y/2), 0), Vector3.new(0,ch["Right Leg"].Size.y/2,0), -80, 80, duration)
  478.                 end)
  479.                 if dea == true and not ch:FindFirstChild("diedbydecapitation") then
  480.                     if ch.Torso:findFirstChild("NeckAttachment") then
  481.                         local headattachment = Instance.new("Attachment", ch.Head)
  482.                         headattachment.Position = Vector3.new(0,-ch.Head.Size.y/2,0)
  483.                         makehingeconnections(ch.Head, headattachment, ch.Torso.NeckAttachment, -50, 50, ragdolldespawntime)
  484.                     else
  485.                         local wed = Instance.new("Weld", ch.Head)
  486.                         wed.Part1 = ch.Head
  487.                         wed.Part0 = ch.Torso
  488.                         wed.C0 = cfnew(0,(ch.Torso.Size.y/2)+(ch.Head.Size.y/2),0)
  489.                     end
  490.                 end
  491.                 if not dea then
  492.                     coroutine.wrap(function()
  493.                         task.wait(duration)
  494.                         for i,v in pairs(savedglue) do
  495.                             v[1].Part0 = v[2]
  496.                             v[1].Part1 = v[3]
  497.                             savedglue[i] = nil
  498.                         end
  499.                         chum.PlatformStand = false
  500.                     end)()
  501.                 end
  502.             elseif chum.RigType == Enum.HumanoidRigType.R15 then
  503.                 local chuppertor = ch.UpperTorso
  504.                 mainpart = chuppertor
  505.                 if not dea then
  506.                     for i,v in pairs(ch:GetDescendants()) do
  507.                         if v:IsA("Motor6D") then
  508.                             if v.Part1.Name ~= "Head" and v.Part0.Name ~= "HumanoidRootPart" then
  509.                                 table.insert(savedglue, {v, v.Part0, v.Part1})
  510.                                 v.Part1 = nil
  511.                                 v.Part0 = nil
  512.                             end
  513.                         end
  514.                     end
  515.                 end
  516.                 if dea == true and not ch:FindFirstChild("diedbydecapitation") then
  517.                     if ch.UpperTorso:findFirstChild("NeckAttachment") then
  518.                         local HeadAttachment = Instance.new("Attachment", ch.Head)
  519.                         HeadAttachment.Position = Vector3.new(0, -0.5, 0)
  520.                         makehingeconnections(ch.Head, HeadAttachment, ch.UpperTorso.NeckAttachment, -50, 50, ragdolldespawntime)
  521.                     else
  522.                         local wed = Instance.new("Weld", ch.Head)
  523.                         wed.Part1 = ch.Head
  524.                         wed.Part0 = ch.UpperTorso
  525.                         wed.C0 = cfnew(0,(ch.UpperTorso.Size.y/2)+(ch.Head.Size.y/2),0)
  526.                     end
  527.                 end
  528.                 pcall(function()
  529.                     makehingeconnections(ch.LowerTorso, ch.LowerTorso.WaistRigAttachment, ch.UpperTorso.WaistRigAttachment, -50, 50, duration)
  530.                     makeballconnections(ch.LeftUpperArm, ch.LeftUpperArm.LeftShoulderRigAttachment, ch.UpperTorso.LeftShoulderRigAttachment, -200, 200, duration)
  531.                     makehingeconnections(ch.LeftLowerArm, ch.LeftLowerArm.LeftElbowRigAttachment, ch.LeftUpperArm.LeftElbowRigAttachment, 0, -60, duration)
  532.                     makehingeconnections(ch.LeftHand, ch.LeftHand.LeftWristRigAttachment, ch.LeftLowerArm.LeftWristRigAttachment, -20, 20, duration)
  533.                     --
  534.                     makeballconnections(ch.RightUpperArm, ch.RightUpperArm.RightShoulderRigAttachment, ch.UpperTorso.RightShoulderRigAttachment, -200, 200, duration)
  535.                     makehingeconnections(ch.RightLowerArm, ch.RightLowerArm.RightElbowRigAttachment, ch.RightUpperArm.RightElbowRigAttachment, 0, -60, duration)
  536.                     makehingeconnections(ch.RightHand, ch.RightHand.RightWristRigAttachment, ch.RightLowerArm.RightWristRigAttachment, -20, 20, duration)
  537.                     --
  538.                     makeballconnections(ch.RightUpperLeg, ch.RightUpperLeg.RightHipRigAttachment, ch.LowerTorso.RightHipRigAttachment, -80, 80, duration)
  539.                     makehingeconnections(ch.RightLowerLeg, ch.RightLowerLeg.RightKneeRigAttachment, ch.RightUpperLeg.RightKneeRigAttachment, 0, 60, duration)
  540.                     makehingeconnections(ch.RightFoot, ch.RightFoot.RightAnkleRigAttachment, ch.RightLowerLeg.RightAnkleRigAttachment, -20, 20, duration)
  541.                     --
  542.                     makeballconnections(ch.LeftUpperLeg, ch.LeftUpperLeg.LeftHipRigAttachment, ch.LowerTorso.LeftHipRigAttachment, -80, 80, duration)
  543.                     makehingeconnections(ch.LeftLowerLeg, ch.LeftLowerLeg.LeftKneeRigAttachment, ch.LeftUpperLeg.LeftKneeRigAttachment, 0, 60, duration)
  544.                     makehingeconnections(ch.LeftFoot, ch.LeftFoot.LeftAnkleRigAttachment, ch.LeftLowerLeg.LeftAnkleRigAttachment, -20, 20, duration)
  545.                 end)
  546.                 if not dea then
  547.                     coroutine.wrap(function()
  548.                         task.wait(duration)
  549.                         for i,v in pairs(savedglue) do
  550.                             v[1].Part0 = v[2]
  551.                             v[1].Part1 = v[3]
  552.                             savedglue[i] = nil
  553.                         end
  554.                         chum.PlatformStand = false
  555.                     end)()
  556.                 end
  557.             end
  558.             if dea then
  559.                 for i,v in pairs(ch:GetChildren()) do
  560.                     if v:IsA("Accessory") then
  561.                         if v:FindFirstChild("Handle") then
  562.                             local attachment1 = v.Handle:FindFirstChildOfClass("Attachment")
  563.                             if attachment1 then
  564.                                 for q,w in pairs(ch:GetChildren()) do
  565.                                     if w:IsA("Part") then
  566.                                         local attachment2 = w:FindFirstChild(attachment1.Name)
  567.                                         if attachment2 then
  568.                                             local hinge = Instance.new("HingeConstraint", v.Handle)
  569.                                             hinge.Attachment0 = attachment1
  570.                                             hinge.Attachment1 = attachment2
  571.                                             hinge.LimitsEnabled = true
  572.                                             hinge.LowerAngle = 0
  573.                                             hinge.UpperAngle = 0
  574.                                         end
  575.                                     end
  576.                                 end
  577.                             end
  578.                         end
  579.                     end
  580.                 end
  581.                 if ch:FindFirstChild("diedbydecapitation") then
  582.                     local cutpart = Instance.new("Part", mainpart)
  583.                     cutpart.Size = Vector3.new(0.05,0.5,0.5)
  584.                     cutpart.CanCollide = false
  585.                     cutpart.Material = "Pebble"
  586.                     cutpart.Shape = "Cylinder"
  587.                     if bloodcolorfromtorso then
  588.                         cutpart.Color = mainpart.Color
  589.                     else
  590.                         cutpart.BrickColor = BrickColor.new("Maroon")
  591.                     end
  592.                     cutpart:BreakJoints()
  593.                     local cutweld = Instance.new("Weld", cutpart)
  594.                     cutweld.Part0 = mainpart
  595.                     cutweld.Part1 = cutpart
  596.                     cutweld.C0 = cfeuler(0,0,math.pi/2) * cfnew((mainpart.Size.y/2),0,0)
  597.                     local pe = Instance.new("ParticleEmitter", cutpart)
  598.                     if bloodcolorfromtorso then
  599.                         pe.Color = ColorSequence.new(mainpart.Color)
  600.                     else
  601.                         pe.Color = ColorSequence.new(Color3.fromRGB(100,0,0))
  602.                     end
  603.                     pe.LightEmission = 0
  604.                     pe.LightInfluence = 1
  605.                     pe.EmissionDirection = "Right"
  606.                     pe.Orientation = Enum.ParticleOrientation.VelocityParallel
  607.                     pe.Size = NumberSequence.new(1,0)
  608.                     pe.Texture = "rbxassetid://243132757"
  609.                     pe.Transparency = NumberSequence.new(0,0.4)
  610.                     pe.Lifetime = NumberRange.new(0.25,0.4)
  611.                     pe.Rate = 300
  612.                     pe.Rotation = NumberRange.new(90)
  613.                     pe.RotSpeed = NumberRange.new(0)
  614.                     pe.Speed = NumberRange.new(15)
  615.                     pe.SpreadAngle = Vector2.new(-15,15)
  616.                     pe.Drag = NumberRange.new(1)
  617.                     pe.Acceleration = Vector3.new(rand(-20,20),-50,rand(-20,20))
  618.                     local pplandotherstuff = {}
  619.                     local hitgroundalready = false
  620.                     table.foreach(workspace:GetDescendants(), function(z,x)
  621.                         if x:FindFirstChildOfClass("Humanoid") then
  622.                             table.insert(pplandotherstuff, x)
  623.                         elseif x:IsA("BasePart") then
  624.                             if not x.CanCollide then
  625.                                 table.insert(pplandotherstuff, x)
  626.                             end
  627.                         end
  628.                     end)
  629.                     coroutine.wrap(function()
  630.                         local hit,position,surface
  631.                         local bloodincreasefunc
  632.                         for i = 1,ragdolldespawntime*10 do
  633.                             task.wait(0.1)
  634.                             local ray = Ray.new(cutpart.Position, Vector3.new(0,-(mainpart.Size.z/2)+(-1),0))
  635.                             hit,position,surface = workspace:FindPartOnRayWithIgnoreList(ray, pplandotherstuff)
  636.                             if hit ~= nil then
  637.                                 hitgroundalready = true
  638.                                 break
  639.                             end
  640.                         end
  641.                         if hitgroundalready then
  642.                             local bloodpartfloor = Instance.new("Part", workspace)
  643.                             bloodpartfloor.Size = Vector3.new(0.05,0.5,0.5)
  644.                             bloodpartfloor.CanCollide = false
  645.                             bloodpartfloor.Material = "Glass"
  646.                             bloodpartfloor.Shape = "Cylinder"
  647.                             bloodpartfloor.Anchored = true
  648.                             bloodpartfloor.CFrame = cfnew(position, position-surface) * cfeuler(math.pi/2,0,math.pi/2)
  649.                             bloodpartfloor:BreakJoints()
  650.                             monar(bloodpartfloor, ragdolldespawntime+2)
  651.                             if bloodcolorfromtorso then
  652.                                 bloodpartfloor.Color = mainpart.Color
  653.                             else
  654.                                 bloodpartfloor.BrickColor = BrickColor.new("Maroon")
  655.                             end
  656.                             local delta
  657.                             local lastframe = tick()
  658.                             local bloodtime = 0
  659.                             bloodincreasefunc = runservice.Stepped:Connect(function()
  660.                                 delta = tick() - lastframe
  661.                                 bloodtime = bloodtime + delta
  662.                                 bloodpartfloor.Size = bloodpartfloor.Size + Vector3.new(0,delta*bloodpuddlesizemultiplier, delta*bloodpuddlesizemultiplier)
  663.                                 if bloodtime > bleedingtime then
  664.                                     pe.Enabled = false
  665.                                     bloodincreasefunc:Disconnect()
  666.                                 end
  667.                                 lastframe = tick()
  668.                             end)
  669.                         end
  670.                     end)()
  671.                 end
  672.             end
  673.         end
  674.     end
  675. end
  676.  
  677. function ragdollkilldude(who)
  678.     who.Archivable = true
  679.     table.foreach(who:GetDescendants(), function(_,hi)
  680.         if hi:IsA("Sound") then
  681.             hi:Destroy()
  682.         end
  683.     end)
  684.     local clr = who:Clone()
  685.     table.foreach(who:GetChildren(), function(_,hi)
  686.         if hi:IsA("BasePart") or hi:IsA("ForceField") or hi:IsA("Accessory") or hi:IsA("Hat") then
  687.             hi:Destroy()
  688.         end
  689.     end)
  690.     clr.Parent = workspace
  691.     clr:BreakJoints()
  692.     ragdollify(clr, ragdolldespawntime, true)
  693. end
  694. function selectionbox(part, linet, surt, color3, surcolor3, transp, maxtime)
  695.     local boxfunc
  696.     local frametick = tick()
  697.     local timepassed = tick()
  698.     local delta
  699.     local selbox = Instance.new("SelectionBox", part)
  700.     selbox.LineThickness = linet
  701.     selbox.SurfaceTransparency = surt
  702.     selbox.Color3 = color3
  703.     selbox.SurfaceColor3 = color3
  704.     selbox.Transparency = transp
  705.     selbox.Adornee = part
  706.     monar(selbox, maxtime)
  707.     tween(maxtime, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, selbox, {Transparency = 1})
  708.     tween(maxtime, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0, selbox, {SurfaceTransparency = 1})
  709. end
  710. function removeselbox(part)
  711.     table.foreach(character:GetDescendants(), function(a,b)
  712.         if b:IsA("SelectionBox") then
  713.             if part == true then
  714.                 b:Destroy()
  715.             elseif part:IsA("BasePart") then
  716.                 if b.Adornee == part then
  717.                     b:Destroy()
  718.                 end
  719.             end
  720.         end
  721.     end)
  722. end
  723.  
  724. function hitperson(hispart, headshotknockback)
  725.     local findh = hispart.Parent:FindFirstChildOfClass("Humanoid")
  726.     if findh then
  727.         if findh.Health > 0 then
  728.             local him = table.find(hitpeople, findh.Parent)
  729.             if not him then
  730.                 playsound("2900321088", 2, 1+math.random(-10,10)/70, 2, 0.2)
  731.                 if not findh:FindFirstChild("dontchangews") then
  732.                     coroutine.wrap(function()
  733.                         coroutine.wrap(function()
  734.                             findh.WalkSpeed = findh.WalkSpeed - 1
  735.                             findh.JumpHeight = findh.JumpHeight - 1
  736.                             wait(0.5)
  737.                             findh.WalkSpeed = findh.WalkSpeed + 1
  738.                             findh.JumpHeight = findh.JumpHeight + 1
  739.                         end)()
  740.                     end)()
  741.                 end
  742.                 if hispart.Name == "Head" then
  743.                     playheadshotid()
  744.                     if swinganimation == 0 then --this is the number before 360 spin headshot insta kill move
  745.                         headshotdeath(findh.Parent)
  746.                         ragdollkilldude(findh.Parent)
  747.                         return
  748.                     elseif findh.Health < damage then
  749.                         headshotdeath(findh.Parent)
  750.                     end
  751.                 end
  752.                 if findh.Health > damage then
  753.                     findh.Health = findh.Health - damage
  754.                     if findh.PlatformStand then
  755.                         push(hispart, 5, 0.3)
  756.                     end
  757.                     if hispart.Name == "Head" then
  758.                         ragdollify(findh.Parent, 1, false)
  759.                         push(hispart, headshotknockback, 0.3)
  760.                     end
  761.                 else
  762.                     if hispart.Name == "Head" then
  763.                         playheadshotid()
  764.                     end
  765.                     ragdollkilldude(findh.Parent)
  766.                 end
  767.             end
  768.         end
  769.     end
  770. end
  771.  
  772. remote.OnServerEvent:Connect(function(WHO, WHAT, parameter1)
  773.     if WHO == player and state ~= "unequipped" then
  774.         if WHAT == "1" then
  775.             headoffset = parameter1
  776.             local findhead = findthing("HeadWeld", character.Torso)
  777.             if findhead and state ~= "swinging" and state ~= "inparrymode" and state ~= "unforeseenconsequence" then
  778.                 tween(0.2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0, findhead, {C0 = cfnew(0,1.15,0) * cfeuler(-headoffset/1.5,0,0) * cfnew(0,0.35,0)})
  779.             end
  780.         elseif WHAT == "2" and state == "swinging" then
  781.             if (handle.Position - parameter1.Position).magnitude < 11 then
  782.                 hitperson(parameter1, 15)
  783.             end
  784.         elseif WHAT == "3" and state == "idle" and tick() > lastparrytick + parrycooldown and not charhum.PlatformStand then
  785.             state = "inparrymode"
  786.             actuallyparied = false
  787.             local backuptick = equiptick
  788.             local donot = Instance.new("BoolValue", charhum)
  789.             donot.Name = "dontchangews"
  790.             charhum.WalkSpeed = charhum.WalkSpeed - 16
  791.             charhum.JumpHeight = charhum.JumpHeight - 7.2
  792.             weldlimb(character.Torso, character["Right Leg"], cfnew(0.5,-2,0), "RightLegWeld")
  793.             weldlimb(character.Torso, character["Left Leg"], cfnew(-0.5,-2,0), "LeftLegWeld")
  794.             pose("parry", 1, 0.2*animslowdownmult, backuptick)
  795.             task.wait(1*animslowdownmult)
  796.             if not actuallyparied then
  797.                 state = "fail"
  798.                 pose("r6stance", 1, 0.4*animslowdownmult, backuptick)
  799.                 charhum.WalkSpeed = charhum.WalkSpeed + 5
  800.                 task.wait(0.4*animslowdownmult)
  801.                 pcall(function()
  802.                     findthing("LeftLegWeld", character):Destroy()
  803.                 end)
  804.                 pcall(function()
  805.                     findthing("RightLegWeld", character):Destroy()
  806.                 end)
  807.                 task.wait(1.4*animslowdownmult)
  808.                 lastparrytick = tick()
  809.                 charhum.WalkSpeed = charhum.WalkSpeed + 11
  810.                 charhum.JumpHeight = charhum.JumpHeight + 7.2
  811.                 donot:Destroy()
  812.                 state = "idle"
  813.             end
  814.         end
  815.     end
  816. end)
  817. --just send ur backup tick to the function and it should work fineeeee
  818. tool.Activated:Connect(function()
  819.     if state == "idle" and not charhum.PlatformStand then
  820.         state = "swinging"
  821.         local donot = Instance.new("BoolValue", charhum)
  822.         donot.Name = "dontchangews"
  823.         for i,v in pairs(hitpeople) do
  824.             hitpeople[i] = nil
  825.         end
  826.         local backuptick = equiptick
  827.         if (tick() - lastswingtick) > 2 then
  828.             swinganimation = 0
  829.         end
  830.         if swinganimation == 0 then
  831.             swinganimation = 1
  832.             charhum.WalkSpeed = charhum.WalkSpeed + speedbuff
  833.             pose("swing", 1, 0.25*animslowdownmult, backuptick)
  834.             task.wait(0.2*animslowdownmult)
  835.             trail.Enabled = true
  836.             remote:FireClient(player, "1")
  837.             playswingid()
  838.             pose("swing", 2, 0.035*animslowdownmult, backuptick)
  839.             task.wait(0.035*animslowdownmult)
  840.             pose("swing", 3, 0.25*animslowdownmult, backuptick)
  841.             task.wait(0.2*animslowdownmult)
  842.             remote:FireClient(player, "2")
  843.             trail.Enabled = false
  844.             charhum.WalkSpeed = charhum.WalkSpeed - speedbuff
  845.             pose("equip", 2, 0.5*animslowdownmult, backuptick)
  846.             task.wait(0.3*animslowdownmult)
  847.             if backuptick == equiptick then
  848.                 state = "idle"
  849.             end
  850.         elseif swinganimation == 1 then
  851.             swinganimation = 2
  852.             charhum.WalkSpeed = charhum.WalkSpeed + speedbuff
  853.             pose("swing2", 1, 0.2*animslowdownmult, backuptick)
  854.             task.wait(0.15*animslowdownmult)
  855.             trail.Enabled = true
  856.             remote:FireClient(player, "1")
  857.             playswingid()
  858.             pose("swing2", 2, 0.08*animslowdownmult, backuptick)
  859.             task.wait(0.08*animslowdownmult)
  860.             pose("swing2", 3, 0.08*animslowdownmult, backuptick)
  861.             task.wait(0.08*animslowdownmult)
  862.             charhum.WalkSpeed = charhum.WalkSpeed - speedbuff
  863.             remote:FireClient(player, "2")
  864.             trail.Enabled = false
  865.             pose("swing2", 4, 0.125*animslowdownmult, backuptick)
  866.             task.wait(0.125*animslowdownmult)
  867.             pose("equip", 2, 0.5*animslowdownmult, backuptick)
  868.             task.wait(0.3*animslowdownmult)
  869.             if backuptick == equiptick then
  870.                 state = "idle"
  871.             end
  872.         elseif swinganimation == 2 then
  873.             swinganimation = 0
  874.             charhum.WalkSpeed = charhum.WalkSpeed + speedbuff
  875.             playspinid()
  876.             pose("swing3", 1, 0.05*animslowdownmult, backuptick)
  877.             task.wait(0.05*animslowdownmult)
  878.             pose("swing3", 2, 0.05*animslowdownmult, backuptick)
  879.             task.wait(0.05*animslowdownmult)
  880.             pose("swing3", 3, 0.05*animslowdownmult, backuptick)
  881.             task.wait(0.05*animslowdownmult)
  882.             playswingid()
  883.             remote:FireClient(player, "1")
  884.             pose("swing3", 4, 0.05*animslowdownmult, backuptick)
  885.             task.wait(0.05*animslowdownmult)
  886.             trail.Enabled = true
  887.             pose("swing3", 5, 0.05*animslowdownmult, backuptick)
  888.             task.wait(0.05*animslowdownmult)
  889.             pose("swing3", 2, 0.05*animslowdownmult, backuptick)
  890.             task.wait(0.05*animslowdownmult)
  891.             pose("swing3", 3, 0.05*animslowdownmult, backuptick)
  892.             task.wait(0.05*animslowdownmult)
  893.             pose("swing3", 4, 0.05*animslowdownmult, backuptick)
  894.             task.wait(0.05*animslowdownmult)
  895.             pose("swing3", 5, 0.1*animslowdownmult, backuptick)
  896.             task.wait(0.1*animslowdownmult)
  897.             remote:FireClient(player, "2")
  898.             trail.Enabled = false
  899.             charhum.WalkSpeed = charhum.WalkSpeed - speedbuff
  900.             pose("equip", 2, 0.5*animslowdownmult, backuptick)
  901.             task.wait(0.5*animslowdownmult)
  902.             if backuptick == equiptick then
  903.                 state = "idle"
  904.             end
  905.         end
  906.         lastswingtick = tick()
  907.         donot:Destroy()
  908.     end
  909. end)
  910. tool.Equipped:Connect(function()
  911.     if state ~= "fail" and state ~= "inparrymode" and state ~= "unforeseenconsequence" then
  912.         state = "equipping"
  913.     end
  914.     validatetick = tick()
  915.     local backuptick = validatetick
  916.     equiptick = validatetick
  917.     player = players:GetPlayerFromCharacter(tool.Parent)
  918.     character = player.Character
  919.     charhum = character:FindFirstChildOfClass("Humanoid")
  920.     --
  921.     parryfunc = charhum.HealthChanged:Connect(function(new)
  922.         if new < oldplayerhealth and state == "inparrymode" or state == "unforeseenconsequence" then
  923.             charhum.Health = oldplayerhealth
  924.             if state == "inparrymode" then
  925.                 state = "unforeseenconsequence"
  926.                 actuallyparied = true
  927.                 playparryid()
  928.                 local oldswinganim = swinganimation
  929.                 local guyhead,distance = searchfornearesthead(20)
  930.                 if guyhead ~= nil then
  931.                     swinganimation = 1
  932.                     hitperson(guyhead, 5)
  933.                     swinganimation = oldswinganim
  934.                     local savedrootpos = character.HumanoidRootPart.CFrame
  935.                     character.Head.CFrame = cfnew(character.Head.Position, Vector3.new(guyhead.Position.x, character.Head.Position.y, guyhead.Position.z))
  936.                     character.Head.CFrame = character.Head.CFrame * cfnew(0,0,-(distance+10))
  937.                     local magnitud = (savedrootpos.p-character.HumanoidRootPart.CFrame.p).magnitude
  938.                     local slice = Instance.new("Part", workspace)
  939.                     Instance.new("SpecialMesh", slice).MeshType = Enum.MeshType.Sphere
  940.                     slice.Material = "Neon"
  941.                     slice.Anchored = true
  942.                     slice.CanCollide = false
  943.                     slice.Size = Vector3.new(0.5,0.5,magnitud)
  944.                     slice.CFrame = cfnew(savedrootpos.p, character.HumanoidRootPart.CFrame.p) * cfnew(0,0,-magnitud/2)
  945.                     local deltas
  946.                     local lastframes = tick()
  947.                     slicefunc = runservice.Stepped:Connect(function()
  948.                         deltas = tick() - lastframes
  949.                         slice.Transparency = slice.Transparency + deltas*2
  950.                         slice.Size = slice.Size + Vector3.new(-deltas*10,-deltas*10,deltas*20)
  951.                         if slice.Transparency >= 1 then
  952.                             slicefunc:Disconnect()
  953.                         end
  954.                         lastframes = tick()
  955.                     end)
  956.                     pose("parry", 2, 0.05*animslowdownmult, backuptick)
  957.                     task.wait(0.2*animslowdownmult)
  958.                     trail.Enabled = true
  959.                     playsound("rbxassetid://4307125568", 2, 1+math.random(-10,10)/70, 3, 0, handle)
  960.                     playswingid()
  961.                     pose("parry", 3, 0.15*animslowdownmult, backuptick)
  962.                     task.wait(0.15*animslowdownmult)
  963.                     pose("parry", 4, 0.2*animslowdownmult, backuptick)
  964.                     task.wait(0.3*animslowdownmult)
  965.                     trail.Enabled = false
  966.                 else
  967.                     selectionbox(character.Head, 0.01, 0.4, Color3.fromRGB(255,255,255), Color3.fromRGB(255,255,255), 0.3, 0.3*animslowdownmult)
  968.                     selectionbox(character["Left Leg"], 0.01, 0.4, Color3.fromRGB(255,255,255), Color3.fromRGB(255,255,255), 0.3, 0.3*animslowdownmult)
  969.                     selectionbox(character["Right Leg"], 0.01, 0.4, Color3.fromRGB(255,255,255), Color3.fromRGB(255,255,255), 0.3, 0.3*animslowdownmult)
  970.                     selectionbox(character["Left Arm"], 0.01, 0.4, Color3.fromRGB(255,255,255), Color3.fromRGB(255,255,255), 0.3, 0.3*animslowdownmult)
  971.                     selectionbox(character["Right Arm"], 0.01, 0.4, Color3.fromRGB(255,255,255), Color3.fromRGB(255,255,255), 0.3, 0.3*animslowdownmult)
  972.                 end
  973.                 pose("r6stance", 1, 0.2*animslowdownmult, backuptick)
  974.                 task.wait(0.2*animslowdownmult)
  975.                 lastparrytick = tick()
  976.                 charhum.WalkSpeed = charhum.WalkSpeed + 16
  977.                 charhum.JumpHeight = charhum.JumpHeight + 7.2
  978.                 pcall(function()
  979.                     findthing("LeftLegWeld", character):Destroy()
  980.                 end)
  981.                 pcall(function()
  982.                     findthing("RightLegWeld", character):Destroy()
  983.                 end)
  984.                 state = "idle"
  985.             end
  986.         end
  987.         oldplayerhealth = charhum.Health
  988.     end)
  989.     --
  990.     weldlimb(character.HumanoidRootPart, character.Torso, cfnew(), "HumanoidRootPartWeld")
  991.     weldlimb(character.Torso, character.Head, cfnew(0,1.5,0), "HeadWeld")
  992.     weldlimb(character.Head, character["Right Arm"], cfnew(1.43301296, -0.691987038, 0.466506958, 0.866025388, 0, 0.5, -0.249999985, -0.866025329, 0.433012664, 0.433012694, -0.5, -0.75), "RightArmWeld")
  993.     weldlimb(character.Head, character["Left Arm"], cfnew(-1.5, -1.5, 0, 1, 0, 0, 0, 0.99999994, 0, 0, 0, 1), "LeftArmWeld")
  994.     local grip = character["Right Arm"]:WaitForChild("RightGrip")
  995.     grip.C0 = cfnew(-0.552619934, -0.59611702, -1.74083042, -0.766044319, -0.271653444, 0.582562745, -0.642787457, 0.32374388, -0.694271207, -2.70096905e-07, -0.906306922, -0.42261833)
  996.     playsound("211059653", 1, 1+math.random(-10,10)/70, 3, 0)
  997.     pose("equip", 1, 0.25, backuptick)
  998.     task.wait(0.25)
  999.     pose("equip", 2, 0.25, backuptick)
  1000.     task.wait(0.2)
  1001.     if state == "equipping" then
  1002.         state = "idle"
  1003.     end
  1004. end)
  1005. tool.Unequipped:Connect(function()
  1006.     if state ~= "fail" and state ~= "inparrymode" and state ~= "unforeseenconsequence" then
  1007.         state = "unequipped"
  1008.     end
  1009.     parryfunc:Disconnect()
  1010.     pcall(function()
  1011.         findthing("HeadWeld", character):Destroy()
  1012.     end)
  1013.     pcall(function()
  1014.         findthing("RightArmWeld", character):Destroy()
  1015.     end)
  1016.     pcall(function()
  1017.         findthing("LeftArmWeld", character):Destroy()
  1018.     end)
  1019.     pcall(function()
  1020.         findthing("HumanoidRootPartWeld", character):Destroy()
  1021.     end)
  1022.     pcall(function()
  1023.         findthing("LeftLegWeld", character):Destroy()
  1024.     end)
  1025.     pcall(function()
  1026.         findthing("RightLegWeld", character):Destroy()
  1027.     end)
  1028. end)
  1029. end))
  1030. for i,v in pairs(mas:GetChildren()) do
  1031.     v.Parent = owner:FindFirstChildOfClass("Backpack")
  1032.     pcall(function() v:MakeJoints() end)
  1033. end
  1034. mas:Destroy()
  1035. for i,v in pairs(cors) do
  1036.     spawn(function()
  1037.         pcall(v)
  1038.     end)
  1039. end
  1040. NLS([[--By Rufus14, a somewhat op katana remake
  1041. local tool = script.Parent
  1042. local handle = tool.Handle
  1043. local remote = tool.RemoteEvent
  1044. local players = game:GetService("Players")
  1045. local runservice = game:GetService("RunService")
  1046. local player = players.LocalPlayer
  1047. while task.wait() and not player.Character do end
  1048. local character = player.Character
  1049. local mouse = player:GetMouse()
  1050. local hitboxloop
  1051. local state = "unequipped"
  1052. local attachments = {}
  1053. local hitpeople = {}
  1054. local at_lastframe = {}
  1055. local ignoreth = {tool, character}
  1056. local validatetick = tick()
  1057. local registering = false
  1058. local multiplehitting = true
  1059. _G.katanaDEBUG000 = false
  1060.  
  1061. function searchforhat(WHATchar)
  1062.     for q,w in pairs(WHATchar:GetDescendants()) do
  1063.         if w.Name == "Handle" and w.ClassName == "Part" then
  1064.             table.insert(ignoreth, w)
  1065.         end
  1066.     end
  1067. end
  1068.  
  1069. function applyspawn(WHO)
  1070.     WHO.CharacterAppearanceLoaded:Connect(function(WHAT)
  1071.         searchforhat(WHAT)
  1072.     end)
  1073. end
  1074.  
  1075. for i,v in pairs(players:GetPlayers()) do
  1076.     if v ~= player then
  1077.         applyspawn(v)
  1078.         if v.Character then
  1079.             searchforhat(v.Character)
  1080.         end
  1081.     end
  1082. end
  1083.  
  1084. players.PlayerAdded:Connect(function(WHo)
  1085.     applyspawn(WHo)
  1086. end)
  1087.  
  1088. table.foreach(handle:GetChildren(), function(_, a)
  1089.     if a.ClassName == "Attachment" and a.Name == "hitat" then
  1090.         a.Changed:Connect(function(WHAT)
  1091.             if WHAT == "Position" then
  1092.                 a.Parent = nil
  1093.             end
  1094.         end)
  1095.         table.insert(attachments, a)
  1096.     end
  1097. end)
  1098.  
  1099. remote.OnClientEvent:Connect(function(WHAT)
  1100.     if WHAT == "1" then
  1101.         for i,v in pairs(at_lastframe) do
  1102.             at_lastframe[i] = nil
  1103.         end
  1104.         for i,v in pairs(hitpeople) do
  1105.             hitpeople[i] = nil
  1106.         end
  1107.         registering = true
  1108.     elseif WHAT == "2" then
  1109.         registering = false
  1110.     end
  1111. end)
  1112.  
  1113. mouse.KeyDown:Connect(function(key)
  1114.     key = key:lower()
  1115.     if key == "q" then
  1116.         remote:FireServer("3")
  1117.     end
  1118. end)
  1119.  
  1120. tool.Equipped:Connect(function()
  1121.     state = "equipped"
  1122.     validatetick = tick()
  1123.     player = players.LocalPlayer
  1124.     character = player.Character
  1125.     mouse = player:GetMouse()
  1126.     local frametick = tick()
  1127.     local delta
  1128.     hitboxloop = runservice.RenderStepped:Connect(function()
  1129.         if character:FindFirstChild("Right Arm") then
  1130.             character["Right Arm"].LocalTransparencyModifier = 0
  1131.         end
  1132.         if character:FindFirstChild("Left Arm") then
  1133.             character["Left Arm"].LocalTransparencyModifier = 0
  1134.         end
  1135.         if (workspace.CurrentCamera.CFrame.p - character.Head.Position).magnitude < 1.5 then
  1136.             character:FindFirstChildOfClass("Humanoid").CameraOffset = Vector3.new(0,0.2,0)
  1137.         else
  1138.             character:FindFirstChildOfClass("Humanoid").CameraOffset = Vector3.new(0,0,0)
  1139.         end
  1140.         if registering then
  1141.             delta = tick() - frametick
  1142.             for i,v in pairs(at_lastframe) do
  1143.                 local ray = Ray.new(v[1].WorldPosition, (v[2] - v[1].WorldPosition).unit*(v[1].WorldPosition - v[2]).magnitude)
  1144.                 local rayhit, raypos = workspace:FindPartOnRayWithIgnoreList(ray, ignoreth)
  1145.                 if rayhit then
  1146.                     local findh = rayhit.Parent:FindFirstChildOfClass("Humanoid")
  1147.                     if findh then
  1148.                         if findh.Health > 0 then
  1149.                             if not table.find(hitpeople, findh.Parent) then
  1150.                                 if not multiplehitting then
  1151.                                     registering = false
  1152.                                 end
  1153.                                 table.insert(hitpeople, findh.Parent)
  1154.                                 remote:FireServer("2", rayhit)
  1155.                             end
  1156.                         end
  1157.                     end
  1158.                 end
  1159.                 if _G.katanaDEBUG000 then
  1160.                     local p = Instance.new("Part", character)
  1161.                     p.Anchored = true
  1162.                     p.CanCollide = false
  1163.                     p.Material = "Neon"
  1164.                     p.Size = Vector3.new(0.1,0.1,(ray.Origin-raypos).magnitude)
  1165.                     p.CFrame = CFrame.new(ray.Origin, raypos) * CFrame.new(0,0,-(ray.Origin-raypos).magnitude/2)
  1166.                     game.Debris:AddItem(p, 2)
  1167.                 end
  1168.                 at_lastframe[i] = nil
  1169.             end
  1170.             table.foreach(attachments, function(_,aa)
  1171.                 table.insert(at_lastframe, {aa, aa.WorldPosition})
  1172.             end)
  1173.             frametick = tick()
  1174.         end
  1175.     end)
  1176.     local charhead = character.Head
  1177.     local backuptick = validatetick
  1178.     while task.wait(0.1) and validatetick == backuptick and state == "equipped" do
  1179.         for i,v in pairs(ignoreth) do
  1180.             if not v:IsDescendantOf(workspace) then
  1181.                 ignoreth[i] = nil
  1182.             end
  1183.         end
  1184.         remote:FireServer("1", (charhead.Position - mouse.Hit.p).unit.y)
  1185.     end
  1186. end)
  1187. tool.Unequipped:Connect(function()
  1188.     state = "unequipped"
  1189.     character:FindFirstChildOfClass("Humanoid").CameraOffset = Vector3.new(0,0,0)
  1190.     hitboxloop:Disconnect()
  1191. end)]], Tool0)
Add Comment
Please, Sign In to add comment