Advertisement
KrYn0MoRe

auto-parry deepwoken sword

Jan 28th, 2023 (edited)
3,214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 35.65 KB | None | 0 0
  1. -- made by 707_maid
  2. -- edited by KrYn0MoRe
  3.  
  4. local plr = owner
  5. local char = plr.Character
  6. local hrp = char:FindFirstChild("HumanoidRootPart")
  7. local hum = char:FindFirstChild("Humanoid")
  8. local Randomness = Random.new()
  9. local wspeed = 1 -- ingame weapon speed stat
  10. local parry_time = 0.2+0.1
  11. local stun_time = 0.4
  12.  
  13. local equipped = false
  14.  
  15. local currentparry = false
  16. local stunned = false
  17. local attacking = false
  18. local parrying = false
  19. local dodging = false
  20. local pc = false
  21. local parryhitConf = false
  22. local pid = 0
  23.  
  24. function can_use()
  25.     if equipped then
  26.         return true
  27.     end
  28. end
  29.  
  30. -- when player equips tool, add welds AND animate
  31.  
  32. -- when player unequips tool, remove all welds.
  33.  
  34. local tool = Instance.new("Tool")
  35.  
  36. local pos1 = CFrame.new(0, .2, -1.5) * CFrame.Angles(0, math.rad(90), math.rad(90))
  37. tool.Grip = pos1
  38. tool.Name = "Sword of Ages Past"
  39. tool.ToolTip = "Deepwoken Combat(?)"
  40. tool.CanBeDropped = false
  41.  
  42. local handle = Instance.new("Part")
  43. handle.Name = "Handle"
  44. handle.Massless = true
  45. handle.Size = Vector3.new(1, 1, 5)
  46. handle.Parent = tool
  47.  
  48. local handlemesh = Instance.new("SpecialMesh")
  49. handlemesh.MeshId = "rbxasset://fonts/sword.mesh"
  50. handlemesh.TextureId = "rbxasset://textures/SwordTexture.png"
  51. handlemesh.Parent = handle
  52.  
  53. local swordswing = Instance.new("Sound")
  54. swordswing.SoundId = "rbxassetid://8907343824" --4954439454
  55. swordswing.Parent = handle
  56.  
  57. local swordhit = Instance.new("Sound")
  58. swordhit.SoundId = "rbxassetid://4981805515"
  59. swordhit.Volume = 2
  60. swordhit.Parent = handle
  61.  
  62. local Unsheath = Instance.new("Sound")
  63. Unsheath.SoundId = "http://www.roblox.com/asset/?id=12222225"
  64. Unsheath.Parent = handle
  65.  
  66. --script.Parent = tool
  67. tool.Parent = plr.Backpack
  68.  
  69. coroutine.wrap(function()
  70.     repeat
  71.         wait(0.1)
  72.     until not tool or not tool.parent
  73. end)()
  74.  
  75. local tweenService = game:GetService("TweenService")
  76. local tweenservice = game:GetService("TweenService")
  77.  
  78. hitpart = nil
  79. Weld1 = nil
  80.  
  81. function Tween(name,style,dirc,time1,cf)
  82.     local twi = TweenInfo.new(time1, Enum.EasingStyle[style], Enum.EasingDirection[dirc], 0, false, 0)
  83.     tweenservice:Create(name, twi, {C0 = cf}):Play()
  84. end
  85. -- so i figured out that the ABOVE tween stacks on top of my animation player, so this may be very cool if it works.
  86.  
  87. local Attachment0
  88. function parryparticle(parent, power)
  89.     if not Attachment0 then
  90.         if not Attachment0 then
  91.             Attachment0 = Instance.new("Attachment")
  92.             ParticleEmitter1 = Instance.new("ParticleEmitter")
  93.             ParticleEmitter2 = Instance.new("ParticleEmitter")
  94.             ParticleEmitter3 = Instance.new("ParticleEmitter")
  95.             ParticleEmitter4 = Instance.new("ParticleEmitter")
  96.             ParticleEmitter5 = Instance.new("ParticleEmitter")
  97.             ParticleEmitter6 = Instance.new("ParticleEmitter")
  98.         end
  99.  
  100.         ParticleEmitter1.Name = "9"
  101.         ParticleEmitter1.Parent = Attachment0
  102.         ParticleEmitter1.Speed = NumberRange.new(24.5, 42)
  103.         ParticleEmitter1.Orientation = Enum.ParticleOrientation.VelocityParallel
  104.         ParticleEmitter1.Rotation = NumberRange.new(90, 90)
  105.         ParticleEmitter1.Color = ColorSequence.new(Color3.new(0.996078, 0.733333, 0.117647),Color3.new(0.996078, 0.733333, 0.117647))
  106.         ParticleEmitter1.Enabled = false
  107.         ParticleEmitter1.LightEmission = 1
  108.         ParticleEmitter1.LightInfluence = 0.25
  109.         ParticleEmitter1.Texture = "rbxassetid://6967099425"
  110.         ParticleEmitter1.Size = NumberSequence.new(2.581249952316284,1.5750000476837158,0.7875000238418579,0)
  111.         ParticleEmitter1.Brightness = 7
  112.         ParticleEmitter1.Acceleration = Vector3.new(0, -17.5, 0)
  113.         ParticleEmitter1.Drag = 7
  114.         ParticleEmitter1.EmissionDirection = Enum.NormalId.Bottom
  115.         ParticleEmitter1.Lifetime = NumberRange.new(0.25, 0.4000000059604645)
  116.         ParticleEmitter1.Rate = 100
  117.         ParticleEmitter1.SpreadAngle = Vector2.new(360, -360)
  118.         ParticleEmitter1.VelocityInheritance = -0.04500000178813934
  119.         ParticleEmitter1.VelocitySpread = 360
  120.         ParticleEmitter2.Name = "3"
  121.         ParticleEmitter2.Parent = Attachment0
  122.         ParticleEmitter2.Speed = NumberRange.new(-0.2875387966632843, 0.2875387966632843)
  123.         ParticleEmitter2.Orientation = Enum.ParticleOrientation.VelocityPerpendicular
  124.         ParticleEmitter2.Rotation = NumberRange.new(-360, 360)
  125.         ParticleEmitter2.Color = ColorSequence.new(Color3.new(0.996078, 0.733333, 0.117647),Color3.new(0.996078, 0.733333, 0.117647))
  126.         ParticleEmitter2.Enabled = false
  127.         ParticleEmitter2.LightEmission = 1
  128.         ParticleEmitter2.Texture = "rbxassetid://6862984716"
  129.         ParticleEmitter2.Transparency = NumberSequence.new(0,0.675000011920929,0.9312499761581421,1)
  130.         ParticleEmitter2.ZOffset = 0.13860000669956207
  131.         ParticleEmitter2.Size = NumberSequence.new{
  132.             NumberSequenceKeypoint.new(0,0),
  133.             NumberSequenceKeypoint.new(0.08,1.7155100107192993),
  134.             NumberSequenceKeypoint.new(0.23,3.6328399181365967),
  135.             NumberSequenceKeypoint.new(0.5,5.3483500480651855),
  136.             NumberSequenceKeypoint.new(1,6.3574700355529785)
  137.         }
  138.         ParticleEmitter2.Brightness = 1.25
  139.         ParticleEmitter2.EmissionDirection = Enum.NormalId.Front
  140.         ParticleEmitter2.Lifetime = NumberRange.new(0.10000000149011612, 0.41999998688697815)
  141.         ParticleEmitter2.Rate = 25
  142.         ParticleEmitter2.RotSpeed = NumberRange.new(-1050, -700)
  143.         ParticleEmitter2.SpreadAngle = Vector2.new(360, -360)
  144.         ParticleEmitter2.VelocitySpread = 360
  145.         ParticleEmitter3.Name = "13"
  146.         ParticleEmitter3.Parent = Attachment0
  147.         ParticleEmitter3.Speed = NumberRange.new(22.399999618530273, 22.399999618530273)
  148.         ParticleEmitter3.Orientation = Enum.ParticleOrientation.VelocityParallel
  149.         ParticleEmitter3.Color = ColorSequence.new(Color3.new(0.996078, 0.733333, 0.117647),Color3.new(0.996078, 0.733333, 0.117647))
  150.         ParticleEmitter3.Enabled = false
  151.         ParticleEmitter3.LightEmission = 1
  152.         ParticleEmitter3.LightInfluence = 0.25
  153.         ParticleEmitter3.Texture = "rbxassetid://7180700683"
  154.         ParticleEmitter3.ZOffset = 0.0279999990016222
  155.         ParticleEmitter3.Size = NumberSequence.new{NumberSequenceKeypoint.new(0,0.3),NumberSequenceKeypoint.new(0.235,0.1559160053730011),NumberSequenceKeypoint.new(0.58,0.05197190120816231),NumberSequenceKeypoint.new(1,0)}
  156.         ParticleEmitter3.Brightness = 3
  157.         ParticleEmitter3.Acceleration = Vector3.new(0, -3.8499999046325684, 0)
  158.         ParticleEmitter3.Drag = 8
  159.         ParticleEmitter3.EmissionDirection = Enum.NormalId.Front
  160.         ParticleEmitter3.Lifetime = NumberRange.new(0.5, 1)
  161.         ParticleEmitter3.Rate = 40
  162.         ParticleEmitter3.RotSpeed = NumberRange.new(-200, 200)
  163.         ParticleEmitter3.SpreadAngle = Vector2.new(360, -360)
  164.         ParticleEmitter3.VelocityInheritance = -0.04500000178813934
  165.         ParticleEmitter3.VelocitySpread = 360
  166.         ParticleEmitter4.Name = "6"
  167.         ParticleEmitter4.Parent = Attachment0
  168.         ParticleEmitter4.Speed = NumberRange.new(0.0020909467712044716, 0.0020909467712044716)
  169.         ParticleEmitter4.Orientation = Enum.ParticleOrientation.VelocityPerpendicular
  170.         ParticleEmitter4.Rotation = NumberRange.new(-360, 360)
  171.         ParticleEmitter4.Color = ColorSequence.new(Color3.new(0.996078, 0.733333, 0.117647),Color3.new(0.996078, 0.733333, 0.117647))
  172.         ParticleEmitter4.Enabled = false
  173.         ParticleEmitter4.LightEmission = 1
  174.         ParticleEmitter4.LightInfluence = 0.25
  175.         ParticleEmitter4.Texture = "rbxassetid://7162072137"
  176.         ParticleEmitter4.Transparency = NumberSequence.new(0,0,0.02500000037252903,0.375,0.737500011920929,0.9375,0.956250011920929,1)
  177.         ParticleEmitter4.ZOffset = 0.27937400341033936
  178.         ParticleEmitter4.Size = NumberSequence.new(0,5.167019844055176,6.034480094909668,6.034480094909668,6.034480094909668)
  179.         ParticleEmitter4.Brightness = 3
  180.         ParticleEmitter4.EmissionDirection = Enum.NormalId.Front
  181.         ParticleEmitter4.Lifetime = NumberRange.new(0.15000000596046448, 0.6000000238418579)
  182.         ParticleEmitter4.Rate = 45
  183.         ParticleEmitter4.RotSpeed = NumberRange.new(-50, 50)
  184.         ParticleEmitter4.SpreadAngle = Vector2.new(360, -360)
  185.         ParticleEmitter4.VelocitySpread = 360
  186.         ParticleEmitter5.Name = "11"
  187.         ParticleEmitter5.Parent = Attachment0
  188.         ParticleEmitter5.Speed = NumberRange.new(0.0638682097196579, 0.0638682097196579)
  189.         ParticleEmitter5.Rotation = NumberRange.new(-360, 360)
  190.         ParticleEmitter5.Color = ColorSequence.new(Color3.new(0.996078, 0.733333, 0.117647),Color3.new(0.996078, 0.733333, 0.117647))
  191.         ParticleEmitter5.Enabled = false
  192.         ParticleEmitter5.LightEmission = 1
  193.         ParticleEmitter5.LightInfluence = 0.25
  194.         ParticleEmitter5.Texture = "rbxassetid://7153311499"
  195.         ParticleEmitter5.Transparency = NumberSequence.new{NumberSequenceKeypoint.new(0,0),NumberSequenceKeypoint.new(0.3,0),NumberSequenceKeypoint.new(0.45,0.04374999925494194),NumberSequenceKeypoint.new(0.5,0.5874999761581421),NumberSequenceKeypoint.new(0.625,0.831250011920929),NumberSequenceKeypoint.new(0.95,0.9624999761581421),NumberSequenceKeypoint.new(1,1)}
  196.         ParticleEmitter5.ZOffset = 0.1574999988079071
  197.         ParticleEmitter5.Size = NumberSequence.new{NumberSequenceKeypoint.new(0,0),NumberSequenceKeypoint.new(0.2,2.7942299842834473),NumberSequenceKeypoint.new(0.5,3.632499933242798),NumberSequenceKeypoint.new(1,4.071599960327148)}
  198.         ParticleEmitter5.Brightness = 2
  199.         ParticleEmitter5.EmissionDirection = Enum.NormalId.Front
  200.         ParticleEmitter5.Lifetime = NumberRange.new(0.15000000596046448, 0.550000011920929)
  201.         ParticleEmitter5.Rate = 35
  202.         ParticleEmitter5.RotSpeed = NumberRange.new(500, 2000)
  203.         ParticleEmitter5.SpreadAngle = Vector2.new(360, -360)
  204.         ParticleEmitter5.VelocitySpread = 360
  205.         ParticleEmitter6.Name = "3"
  206.         ParticleEmitter6.Parent = Attachment0
  207.         ParticleEmitter6.Speed = NumberRange.new(-0.13348077237606049, 0.13348077237606049)
  208.         ParticleEmitter6.Orientation = Enum.ParticleOrientation.VelocityPerpendicular
  209.         ParticleEmitter6.Rotation = NumberRange.new(-360, 360)
  210.         ParticleEmitter6.Color = ColorSequence.new(Color3.new(0.996078, 0.733333, 0.117647),Color3.new(0.996078, 0.733333, 0.117647))
  211.         ParticleEmitter6.Enabled = false
  212.         ParticleEmitter6.LightEmission = 1
  213.         ParticleEmitter6.LightInfluence = 0.25
  214.         ParticleEmitter6.Texture = "rbxassetid://7160024951"
  215.         ParticleEmitter6.ZOffset = -0.17499999701976776
  216.         ParticleEmitter6.Size = NumberSequence.new{
  217.             NumberSequenceKeypoint.new(0,0),
  218.             NumberSequenceKeypoint.new(0.05,0.610414981842041),
  219.             NumberSequenceKeypoint.new(0.113,2.1983799934387207),
  220.             NumberSequenceKeypoint.new(0.149,4.335229873657227),
  221.             NumberSequenceKeypoint.new(0.187,6.656670093536377),
  222.             NumberSequenceKeypoint.new(0.196,6.824490070343018),
  223.             NumberSequenceKeypoint.new(0.208,6.600729942321777),
  224.             NumberSequenceKeypoint.new(0.218,5.733689785003662),
  225.             NumberSequenceKeypoint.new(0.242,3.6639599800109863),
  226.             NumberSequenceKeypoint.new(0.276,2.013780117034912),
  227.             NumberSequenceKeypoint.new(0.313,1.0307400226593018),
  228.             NumberSequenceKeypoint.new(0.344,0.5097079873085022),
  229.             NumberSequenceKeypoint.new(0.369,0.2718450129032135),
  230.             NumberSequenceKeypoint.new(0.401,0.15857599675655365),
  231.             NumberSequenceKeypoint.new(0.44,0.056633900851011276),
  232.             NumberSequenceKeypoint.new(0.524,0),
  233.             NumberSequenceKeypoint.new(1,0)
  234.         }
  235.         ParticleEmitter6.Brightness = 5
  236.         ParticleEmitter6.EmissionDirection = Enum.NormalId.Front
  237.         ParticleEmitter6.Lifetime = NumberRange.new(0.6499999761581421, 0.949999988079071)
  238.         ParticleEmitter6.Rate = 27
  239.         ParticleEmitter6.RotSpeed = NumberRange.new(111, 111)
  240.         ParticleEmitter6.SpreadAngle = Vector2.new(360, -360)
  241.         ParticleEmitter6.VelocitySpread = 360
  242.     end
  243.     local awr = (power/10)*2
  244.     awr = math.clamp(awr,1,power+1)
  245.     Attachment0.Parent = parent
  246.     for i,v in pairs(Attachment0:GetChildren()) do
  247.         v:Emit(awr)
  248.     end
  249. end
  250.  
  251.  
  252. function makewelds(target)
  253.     local WeldFolder = Instance.new("Folder")
  254.     WeldFolder.Parent = target
  255.     local RSweld = Instance.new("Weld")
  256.     local motor = target.Torso["Right Shoulder"]
  257.     WeldFolder.Name = "WeldFolder"
  258.     RSweld.C0 = motor.C0
  259.     RSweld.C1 = motor.C1
  260.     RSweld.Parent = WeldFolder
  261.     RSweld.Name = "Right Shoulder"
  262.     RSweld.Part0 = motor.Part0
  263.     RSweld.Part1 = motor.Part1
  264.  
  265.     local LSweld = Instance.new("Weld")
  266.     local motor = target.Torso["Left Shoulder"]
  267.     LSweld.C0 = motor.C0
  268.     LSweld.C1 = motor.C1
  269.     LSweld.Parent = WeldFolder
  270.     LSweld.Name = "Left Shoulder"
  271.     LSweld.Part0 = motor.Part0
  272.     LSweld.Part1 = motor.Part1
  273.  
  274.     local NKweld = Instance.new("Weld")
  275.     local motor = target.Torso["Neck"]
  276.     NKweld.C0 = motor.C0
  277.     NKweld.C1 = motor.C1
  278.     NKweld.Parent = WeldFolder
  279.     NKweld.Name = "Neck"
  280.     NKweld.Part0 = motor.Part0
  281.     NKweld.Part1 = motor.Part1
  282.  
  283.     local TSweld = Instance.new("Weld")
  284.     local motor = target.HumanoidRootPart["RootJoint"]
  285.     TSweld.C0 = motor.C0
  286.     TSweld.C1 = motor.C1
  287.     TSweld.Parent = WeldFolder
  288.     TSweld.Name = "RootJoint"
  289.     TSweld.Part0 = motor.Part0
  290.     TSweld.Part1 = motor.Part1
  291.     if target == char then
  292.         RA = RSweld
  293.         LA = LSweld
  294.         NE = NKweld
  295.         RJ = TSweld
  296.     end
  297. end
  298. local CF = CFrame.new
  299. local rightdefault = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  300. local leftdefault = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  301. local headdefault = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  302. local torsodefault = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  303.  
  304. local hurttorso = CFrame.new(0, 0, 0.200000018, -1, 0, 0, 0, -0.173648179, 0.98480773, 0, 0.98480773, 0.173648179)
  305. local hurthead = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0.087155737, 0.99619478, 0, 0.99619478, -0.087155737)
  306. local hurtright = CFrame.new(1.00000024, 0.499999762, -1.04308128e-07, 0.355492771, -0.669611037, 0.652108967, 0.569246948, 0.708471239, 0.417164922, -0.741338611, 0.222911909, 0.633030415)
  307. local hurtleft = CFrame.new(-0.999999881, 0.500000119, -5.96046448e-08, 0.409517139, 0.706587732, -0.577087164, -0.667111874, 0.66341418, 0.338885576, 0.622300088, 0.246202216, 0.743052542)
  308.  
  309. RightArmC0,LeftArmC0,TorsoC0,HeadC0 = rightdefault,leftdefault,torsodefault,headdefault
  310.  
  311. function removewelds()
  312.     Tween(RA, "Cubic", "Out", 0.2, rightdefault)
  313.     Tween(LA, "Cubic", "Out", 0.2, leftdefault)
  314.     Tween(RJ, "Cubic", "Out", 0.2, torsodefault)
  315.     Tween(NE, "Cubic", "Out", 0.2, headdefault)
  316.     task.wait(0.2)
  317.     pcall(function()
  318.         char:FindFirstChild("WeldFolder"):Destroy()
  319.     end)
  320. end
  321.  
  322. -- Animations put in functions to make it easier to read
  323.  
  324. function idle()
  325.     Tween(RA, "Cubic", "Out", 0.5, rightdefault * CF(0.253123045, -0.0402455032, -0.207198858, 0.554888189, -0.785348475, -0.274457037, 0.826460123, 0.558132231, 0.0738362223, 0.0951962918, -0.267798901, 0.958760262))
  326.     Tween(LA, "Cubic", "Out", 0.5, leftdefault * CF(-0.0372788236, -0.0369110703, -0.00934666395, 0.998309314, -0.0121976202, -0.0568294711, 0.0300782546, 0.945051253, 0.325535834, 0.0497359969, -0.326694846, 0.943820357))
  327.     Tween(RJ, "Cubic", "Out", 0.5, torsodefault * CF(0, 0, 0, 0.871976554, -0.489547729, 0, 0.489547729, 0.871976554, 0, 0, 0, 1))
  328.     Tween(NE, "Cubic", "Out", 0.5, headdefault * CF(0, 0, 0, 0.894356966, 0.447353959, 0, -0.447353959, 0.894356966, 0, 0, 0, 1))
  329. end
  330.  
  331. function parryinit()
  332.     Tween(RJ, "Linear", "Out", 0.1, TorsoC0 * CF(0, 0, -0.017364502, 0.890735924, -0.454521209, 0, 0.454521209, 0.890735924, 0, 0, 0, 1)
  333.     )
  334.     Tween(NE, "Linear", "Out", 0.1, HeadC0 * CF(0, 0, 0, 0.924134791, 0.382066369, 0, -0.382066369, 0.924134791, 0, 0, 0, 1)
  335.     )
  336.     Tween(RA, "Linear", "Out", 0.1, RightArmC0 * CF(0.437100291, -0.210086942, -0.490853608, -0.201303929, -0.387932032, 0.899436057, 0.902729988, 0.282938659, 0.324074328, -0.380204141, 0.877185285, 0.293241322)
  337.     )
  338.     Tween(LA, "Linear", "Out", 0.1, LeftArmC0 * CF(2.40281224e-07, 2.38418579e-07, 2.98023224e-07, 0.997926712, 0.0621465854, 0.0167354792, -0.0639483929, 0.928053439, 0.366916031, 0.00727114081, -0.367225528, 0.930103421)
  339.     )
  340.     task.wait(parry_time-0.2)
  341.     Tween(RJ, "Linear", "Out", 0.2, TorsoC0 * CF(0, 0, -0.017364502, 0.872435212, -0.488729805, 0, 0.488729805, 0.872435212, 0, 0, 0, 1)
  342.     )
  343.     Tween(NE, "Linear", "Out", 0.2, HeadC0 * CF(0, 0, 0, 0.892648876, 0.450752497, 0, -0.450752497, 0.892648876, 0, 0, 0, 1)
  344.     )
  345.     Tween(RA, "Linear", "Out", 0.2, RightArmC0 * CF(0.437095642, -0.210086823, -0.490859985, -0.328281432, -0.406485021, 0.852643549, 0.935400903, -0.0143626994, 0.353297114, -0.131363764, 0.913544416, 0.384941578)
  346.     )
  347.     Tween(LA, "Linear", "Out", 0.2, LeftArmC0 * CF(2.40281224e-07, 1.49011612e-07, 3.57627869e-07, 0.997926712, 0.0575846173, 0.0287451968, -0.0639483929, 0.836690366, 0.543929815, 0.00727114081, -0.544640303, 0.838638067)
  348.     )
  349.     task.wait(0.2)
  350.     if parrying then return end
  351.     Tween(RJ, "Linear", "Out", 0.2, TorsoC0 * CF(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  352.     )
  353.     Tween(NE, "Linear", "Out", 0.2, HeadC0 * CF(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  354.     )
  355.     Tween(RA, "Linear", "Out", 0.2, RightArmC0 * CF(5.96046448e-08, -1.49011612e-08, 3.27825546e-07, 0.0511461198, -0.810129523, 0.584015608, 0.724196732, 0.432763249, 0.536893904, -0.687694073, 0.395482183, 0.608827233)
  356.     )
  357.     Tween(LA, "Linear", "Out", 0.2, LeftArmC0 * CF(2.40281224e-07, 2.38418579e-07, 2.98023224e-07, 0.997926712, 0.0621465854, 0.0167354792, -0.0639483929, 0.928053439, 0.366916031, 0.00727114081, -0.367225528, 0.930103421)
  358.     )
  359. end
  360.  
  361. function parryhit1()
  362.     Tween(RJ, "Cubic", "Out", 0, TorsoC0 * CF(0, 0, -0.237365723, 0.997615039, -0.0690237582, 0, 0.0690237582, 0.997615039, 0, 0, 0, 1))
  363.     Tween(NE, "Cubic", "Out", 0, HeadC0 * CF(0, 0, 0, 0.992203534, -0.124628134, 0, 0.124628134, 0.992203534, 0, 0, 0, 1))
  364.     Tween(RA, "Cubic", "Out", 0, RightArmC0 * CF(0.437100291, -0.210086942, -0.490853608, -0.201303929, -0.387932032, 0.899436057, 0.902729988, 0.282938659, 0.324074328, -0.380204141, 0.877185285, 0.293241322))
  365.     Tween(LA, "Cubic", "Out", 0, leftdefault)
  366.     task.wait()
  367.     Tween(RJ, "Cubic", "Out", 0.25/wspeed, TorsoC0 * CF(0, 0, -0.237365723, 0.741440952, 0.671018124, 0, -0.671018124, 0.741440952, 0, 0, 0, 1))
  368.     Tween(NE, "Cubic", "Out", 0.25/wspeed, HeadC0 * CF(0, 0, 0, 0.84392333, -0.536463618, 0, 0.536463618, 0.84392333, 0, 0, 0, 1))
  369.     Tween(RA, "Cubic", "Out", 0.25/wspeed, RightArmC0 * CF(0.275326729, 0.246267557, 0.193191528, -0.762836814, -0.379420042, -0.523564994, 0.639148772, -0.564982176, -0.521808445, -0.097820282, -0.732690573, 0.673495173))
  370.     Tween(LA, "Cubic", "Out", 0.25/wspeed, leftdefault)
  371. end
  372.  
  373. function parryhit2()
  374.     Tween(RJ, "Cubic", "Out", 0/wspeed, TorsoC0 * CF(0, 0, -0.237365723, 0.997615039, -0.0690237582, 0, 0.0690237582, 0.997615039, 0, 0, 0, 1))
  375.     Tween(NE, "Cubic", "Out", 0/wspeed, HeadC0 * CF(0, 0, 0, 0.992203534, -0.124628134, 0, 0.124628134, 0.992203534, 0, 0, 0, 1))
  376.     Tween(RA, "Cubic", "Out", 0/wspeed, RightArmC0 * CF(0.353574634, -0.143764973, -0.307957739, 0.236400411, -0.421790928, 0.875332475, 0.96426487, 0.212740913, -0.157906175, -0.119615674, 0.881381452, 0.457010388))
  377.     Tween(LA, "Cubic", "Out", 0/wspeed, leftdefault)
  378.     task.wait()
  379.     Tween(RJ, "Cubic", "Out", 0.25/wspeed, TorsoC0 * CF(0, 0, -0.237365723, 0.164158851, -0.986434042, 0, 0.986434042, 0.164158851, 0, 0, 0, 1))
  380.     Tween(NE, "Cubic", "Out", 0.25/wspeed, HeadC0 * CF(0, 0, 0, 0.42178008, 0.906698108, 0, -0.906698108, 0.42178008, 0, 0, 0, 1))
  381.     Tween(RA, "Cubic", "Out", 0.25/wspeed, RightArmC0 * CF(0.472629607, 0.627322912, -0.102371633, 0.524152279, -0.695814967, 0.491024971, 0.273191363, -0.408723652, -0.870810747, 0.806616783, 0.590581179, -0.0241426528))
  382.     Tween(LA, "Cubic", "Out", 0.25/wspeed, leftdefault)
  383. end
  384.  
  385. function swing1start()
  386.     Tween(RJ, "Cubic", "Out", 0.1/wspeed, TorsoC0 * CF(-3.0156225e-06, 2.80258246e-06, -0.129366755, -0.0833973661, 0.975065291, 0.205651566, -0.996362269, -0.085218899, 4.03285183e-11, 0.0175253991, -0.204903454, 0.978625298))
  387.     Tween(NE, "Cubic", "Out", 0.1/wspeed, HeadC0 * CF(1.13323331e-05, -1.02063641e-05, 3.87430191e-07, 0.667719245, -0.742583275, -0.0521643311, 0.743154764, 0.669024646, -0.011267731, 0.0432664528, -0.0312424917, 0.998574972))
  388.     Tween(RA, "Cubic", "Out", 0.1/wspeed, RightArmC0 * CF(0.808544159, 0.332889795, 0.302891731, -0.754851222, -0.465988874, -0.461577982, 0.58568579, -0.162100837, -0.794163764, 0.295249194, -0.869814873, 0.395284951))
  389.     Tween(LA, "Cubic", "Out", 0.1/wspeed, LeftArmC0 * CF(0.024444133, 4.529953e-06, 0.285624623, 0.98064661, 0.0125271231, -0.195384979, 0.145076737, 0.623639524, 0.768131793, 0.131472275, -0.781611681, 0.609752595))
  390.     task.wait(0.1/wspeed)
  391.     if stunned then return end
  392.     Tween(RJ, "Cubic", "Out", 0.1/wspeed, TorsoC0 * CF(-3.0156225e-06, 2.80234963e-06, -0.12936677, -0.372502357, 0.904958248, 0.205651566, -0.924723983, -0.380638421, 4.03285183e-11, 0.0782788768, -0.190170929, 0.978625298))
  393.     Tween(NE, "Cubic", "Out", 0.1/wspeed, HeadC0 * CF(1.13323331e-05, -1.02063641e-05, 3.87430191e-07, 0.667719245, -0.742583275, -0.0521643311, 0.743154764, 0.669024646, -0.011267731, 0.0432664528, -0.0312424917, 0.998574972))
  394.     Tween(RA, "Cubic", "Out", 0.1/wspeed, RightArmC0 * CF(0.692619324, 0.213352442, 0.24357605, -0.754850984, -0.465987623, -0.461579025, 0.585686088, -0.162100822, -0.794162571, 0.295247823, -0.869815171, 0.395284474))
  395.     Tween(LA, "Cubic", "Out", 0.1/wspeed, LeftArmC0 * CF(0.024444133, 4.529953e-06, 0.285624623, 0.98064661, 0.0125271231, -0.195384979, 0.145076737, 0.623639524, 0.768131793, 0.131472275, -0.781611681, 0.609752595))
  396. end
  397.  
  398. --[[
  399.  
  400.     Tween(RJ, "Cubic", "Out", 0.1/wspeed, )
  401.     Tween(NE, "Cubic", "Out", 0.1/wspeed, )
  402.     Tween(RA, "Cubic", "Out", 0.1/wspeed, )
  403.   Tween(LA, "Cubic", "Out", 0.1/wspeed, )
  404.  
  405. ]]
  406.  
  407. function swing1()
  408.     if stunned then return end
  409.     Tween(RJ, "Linear", "Out", 0.05/wspeed, TorsoC0 * CF(-0.0949609429, -0.0313199982, -0.383384466, -0.212255403, -0.927568316, 0.307513624, 0.967613339, -0.155489773, 0.198865235, -0.136645868, 0.339764506, 0.930531025))
  410.     Tween(NE, "Linear", "Out", 0.05/wspeed, HeadC0 * CF(1.12727284e-05, -2.49519944e-05, 1.54972076e-05, 0.429806679, 0.86993897, -0.24181062, -0.861821711, 0.475136489, 0.1775067, 0.269313037, 0.132104084, 0.953949153))
  411.     Tween(RA, "Linear", "Out", 0.05/wspeed, RightArmC0 * CF(0.467136383, 0.004799366, -0.174585342, 0.668491185, -0.698539495, 0.255269557, 0.189593285, -0.171830356, -0.966710687, 0.719148576, 0.694634736, 0.0175713897))
  412.     Tween(LA, "Linear", "Out", 0.05/wspeed, LeftArmC0 * CF(0.0244354978, 3.20374966e-06, 0.285625339, 0.875230908, -0.427049339, -0.227155745, 0.483406305, 0.755727708, 0.441807598, -0.0170057267, -0.496492147, 0.867874563))
  413.     task.wait(0.05/wspeed)
  414.     if stunned then return end
  415.     Tween(RJ, "Cubic", "Out", 0.1/wspeed, TorsoC0 * CF(-0.0949425623, -0.0313136987, -0.383386642, -0.409543812, -0.874684095, 0.259232759, 0.901998758, -0.345670134, 0.258670419, -0.136645868, 0.339764506, 0.930531025))
  416.     Tween(NE, "Cubic", "Out", 0.1/wspeed, HeadC0 * CF(1.12727284e-05, -2.49519944e-05, 1.54972076e-05, 0.429806679, 0.86993897, -0.24181062, -0.861821711, 0.475136489, 0.1775067, 0.269313037, 0.132104084, 0.953949153))
  417.     Tween(RA, "Cubic", "Out", 0.1/wspeed, RightArmC0 * CF(0.801387787, 0.0995912552, 0.184989929, 0.668491185, -0.698539436, 0.25526917, 0.189593032, -0.171830028, -0.966710687, 0.719148099, 0.694634616, 0.017571345))
  418.     Tween(LA, "Cubic", "Out", 0.1/wspeed, LeftArmC0 * CF(0.0244354978, 3.20374966e-06, 0.285625339, 0.875230908, -0.427049339, -0.227155745, 0.483406305, 0.755727708, 0.441807598, -0.0170057267, -0.496492147, 0.867874563))
  419. end
  420.  
  421. function swing2start()
  422.     Tween(RJ, "Cubic", "Out", 0.1/wspeed, TorsoC0 * CF(0, 0, 0, 0.198906094, -0.937997699, -0.283895493, 0.980018556, 0.190377474, 0.0576198697, 0, -0.289683789, 0.957122386))
  423.     Tween(NE, "Cubic", "Out", 0.1/wspeed, HeadC0 * CF(-7.4505806e-09, -2.23517418e-08, -8.94069672e-08, 0.661991417, 0.73673898, -0.137778834, -0.748950899, 0.643115997, -0.159606993, -0.0289809313, 0.208848059, 0.977518618))
  424.     Tween(RA, "Cubic", "Out", 0.1/wspeed, RightArmC0 * CF(0.250148356, -0.40301916, -0.413149893, -0.306067944, -0.924195528, 0.228440389, 0.729933321, -0.0737701803, 0.679525733, -0.611162603, 0.374727339, 0.697179854))
  425.     Tween(LA, "Cubic", "Out", 0.1/wspeed, LeftArmC0 * CF(0, 0, 0, 1, 0, 0, 0, 0.73340255, 0.67979461, 0, -0.67979461, 0.73340255))
  426.     task.wait(0.1/wspeed)
  427.     if stunned then return end
  428.     Tween(RJ, "Cubic", "Out", 0.1/wspeed, TorsoC0 * CF(0, 0, 0, -0.120492943, -0.916954637, -0.380362481, 0.992642641, -0.115889221, -0.0350751653, -0.0119175743, -0.38179034, 0.924172103))
  429.     Tween(NE, "Cubic", "Out", 0.1/wspeed, HeadC0 * CF(-7.4505806e-09, -2.23517418e-08, -8.94069672e-08, 0.661991417, 0.73673898, -0.137778834, -0.748950899, 0.643115997, -0.159606993, -0.0289809313, 0.208848059, 0.977518618))
  430.     Tween(RA, "Cubic", "Out", 0.1/wspeed, RightArmC0 * CF(0.250148356, -0.40301916, -0.413149893, -0.306067944, -0.924195528, 0.228440389, 0.729933321, -0.0737701803, 0.679525733, -0.611162603, 0.374727339, 0.697179854))
  431.     Tween(LA, "Cubic", "Out", 0.1/wspeed, LeftArmC0 * CF(-0.0318676047, -0.0096270144, 0.273177326, 0.996916771, 0.00765857799, -0.0780917108, 0.0567651987, 0.616705775, 0.785144389, 0.0541727021, -0.787156463, 0.614369571))
  432. end
  433.  
  434. function swing2()
  435.     if stunned then return end
  436.     Tween(RJ, "Cubic", "Out", 0.1/wspeed, TorsoC0 * CF(1.78813934e-07, 1.32247806e-06, -0.355707526, 0.122497074, 0.824429333, -0.552549303, -0.992429793, 0.106692582, -0.0608257912, 0.00880634692, 0.555817366, 0.831257761))
  437.     Tween(NE, "Cubic", "Out", 0.1/wspeed, HeadC0 * CF(1.50203705e-05, 2.14129686e-05, -1.75535679e-05, 0.569904983, -0.75730288, 0.318905413, 0.747102082, 0.63913095, 0.182620049, -0.342121035, 0.134178847, 0.930026472))
  438.     Tween(RA, "Cubic", "Out", 0.1/wspeed, RightArmC0 * CF(0.71099484, -0.243997157, 0.310643762, 0.723380327, -0.597163796, -0.346577942, 0.333846271, -0.136870101, 0.932637811, -0.604373693, -0.790355563, 0.100351766))
  439.     Tween(LA, "Cubic", "Out", 0.1/wspeed, LeftArmC0 * CF(-0.0318629295, -0.00964009762, 0.273173332, 0.964600503, 0.181857437, -0.190980852, 0.0762729272, 0.500853956, 0.862164557, 0.252444565, -0.846211076, 0.469253182))
  440. end
  441.  
  442. handle.CanCollide = true
  443. handle.Massless = true
  444. tool.CanBeDropped = true
  445.  
  446. tool.Equipped:Connect(function()
  447.     char = tool.Parent
  448.     plr = game:GetService("Players"):GetPlayerFromCharacter(char)
  449.     hrp = char:FindFirstChild("HumanoidRootPart")
  450.     hum = char:FindFirstChild("Humanoid")
  451.  
  452.     if char and hrp and hum and hum.Health > 0 then else
  453.         tool.Parent = workspace
  454.         return
  455.     end
  456.  
  457.     if hitpart then hitpart:Destroy() end
  458.  
  459.     hitpart = Instance.new("Part")
  460.     Weld1 = Instance.new("Weld")
  461.     hitpart.Parent = hrp
  462.     hitpart.Color = Color3.new(1, 0, 0)
  463.     hitpart.Size = Vector3.new(4, 2.875, 4.375)
  464.     hitpart.BottomSurface = Enum.SurfaceType.Smooth
  465.     hitpart.BrickColor = BrickColor.new("Really red")
  466.     hitpart.CanCollide = false
  467.     hitpart.Massless = true
  468.     hitpart.Material = Enum.Material.ForceField
  469.     hitpart.TopSurface = Enum.SurfaceType.Smooth
  470.     hitpart.brickColor = BrickColor.new("Really red")
  471.     hitpart.Transparency = 1
  472.     Weld1.Name = "Part"
  473.     Weld1.Parent = hitpart
  474.     Weld1.C0 = CFrame.new(0.0511103868, 0.548256874, -2.67054749, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  475.     Weld1.Part0 = hitpart.Parent
  476.     Weld1.Part1 = hitpart
  477.  
  478.     hitpart:SetNetworkOwner(plr)
  479.  
  480.     connect_char()
  481.  
  482.     if not char:FindFirstChild("WeldFolder") then
  483.         makewelds(char)
  484.     end
  485.  
  486.     Unsheath:Play()
  487.     idle() -- i put animation in function because LAZY!
  488.     task.wait(0.5) -- wait for animations to be done before continuing the script
  489.  
  490.     equipped = true
  491. end)
  492.  
  493. local last_stun = 0
  494.  
  495. function stunfx(st)
  496.     for i,v in pairs(char:GetChildren()) do
  497.         if v:IsA("BasePart") then
  498.             local col = Color3.new(1, 1, 0)
  499.             local stunbox = Instance.new("SelectionBox")
  500.             stunbox.LineThickness = 0.05
  501.             stunbox.Color3 = col
  502.             stunbox.SurfaceColor3 = col
  503.             stunbox.Visible = true
  504.             stunbox.Transparency = 0.3
  505.             stunbox.SurfaceTransparency = 0.3
  506.             stunbox.Adornee = v
  507.             stunbox.Parent = v
  508.             game:GetService("TweenService"):Create(stunbox,TweenInfo.new(st),{
  509.                 Transparency = 1,
  510.                 SurfaceTransparency = 1,
  511.             }):Play()
  512.             game:GetService("Debris"):AddItem(stunbox,st+0.1)
  513.         end
  514.     end
  515. end
  516.  
  517. local combo = 0
  518. local attacking = false
  519. local explosion_ff = {}
  520. local aid = 0
  521. tool.Activated:Connect(function()
  522.     if can_use() and not attacking --[[and not parrying]] and not stunned then
  523.         --[[
  524.         if currentparry then
  525.             if not parryhitConf then
  526.                 return
  527.             end
  528.         end
  529.         ]]
  530.         attacking = true
  531.         aid += 1
  532.         local cid = aid
  533.         local hit = false
  534.         for i,v in ipairs(explosion_ff) do
  535.             v:Destroy()
  536.         end
  537.         if combo % 2 == 0 then
  538.             swing1start()
  539.         else
  540.             swing2start()    
  541.         end    
  542.         hum.WalkSpeed = 12
  543.         task.wait(0.15/wspeed)
  544.         coroutine.wrap(function()
  545.             if combo % 2 == 0 then
  546.                 swing1()
  547.             else
  548.                 swing2()    
  549.             end
  550.         end)()
  551.         combo += 1
  552.         swordswing.PlaybackSpeed = math.random(95,105)/100
  553.         swordswing:Play()
  554.         local candamage = true
  555.         local params = OverlapParams.new()
  556.         params.FilterDescendantsInstances = {char}
  557.         params.FilterType = Enum.RaycastFilterType.Blacklist
  558.         params.MaxParts = 100
  559.         local connection = game:GetService("RunService").Heartbeat:Connect(function()
  560.             for _,part in ipairs(workspace:GetPartsInPart(hitpart,params)) do
  561.                 local thum = part.Parent:FindFirstChildOfClass("Humanoid")
  562.                 if thum and candamage and not stunned and not attacked and aid == cid then
  563.                     swordhit.PlaybackSpeed = math.random(90,110)/100
  564.                     swordhit:Play()
  565.                     candamage = false
  566.                     hit = false
  567.                     attacked = true
  568.                     thum:TakeDamage(20)
  569.                     if thum:GetAttribute("parry") then
  570.                         if char:FindFirstChild("WeldFolder") then
  571.                         else
  572.                             tool.Parent = char
  573.                         end
  574.                         stunned = true
  575.  
  576.                         coroutine.wrap(function()
  577.                             if math.random(1,2)==1 then
  578.                                 parryhit1()
  579.                             else
  580.                                 parryhit2()
  581.                             end
  582.                         end)()
  583.  
  584.                         last_stun = os.clock()
  585.                         stunfx(stun_time)
  586.                         aid += 1
  587.  
  588.                         local cid = aid
  589.                         repeat
  590.                             task.wait()
  591.                         until os.clock()-last_stun >= stun_time
  592.  
  593.                         stunned = false
  594.                         if aid == cid then
  595.                             idle()
  596.                         end
  597.                         break
  598.                     end
  599.                     local roottarget = part.Parent:FindFirstChild("HumanoidRootPart")
  600.                     local BodyVelocity = Instance.new("BodyVelocity")
  601.                     BodyVelocity.Parent = roottarget
  602.                     BodyVelocity.MaxForce = Vector3.new(80000,80000,80000)
  603.                     BodyVelocity.Velocity = hrp.CFrame.LookVector * 15
  604.                     game:GetService("Debris"):AddItem(BodyVelocity, 0.2)
  605.                 end
  606.             end
  607.         end)
  608.         task.wait(.15/wspeed)
  609.         connection:Disconnect()
  610.         hum.WalkSpeed = 16
  611.         task.wait(.05/wspeed)
  612.         attacked = false
  613.         attacking = false
  614.         task.wait(.1/wspeed)
  615.         if can_use() and aid == cid then
  616.             idle()
  617.         end
  618.     end
  619. end)
  620.  
  621. tool.Unequipped:Connect(function()
  622.     equipped = false
  623.     removewelds()
  624.     tool.Grip = pos1
  625. end)
  626.  
  627. local parry = Instance.new("Sound")
  628. parry.SoundId = "rbxassetid://4954186776"
  629. parry.Volume = 2
  630. parry.Parent = handle
  631.  
  632. pcall(function()
  633.     local sfx = Instance.new("EchoSoundEffect")
  634.     sfx.Parent = parry
  635.     sfx.DryLevel = 3
  636.     sfx.WetLevel = -6
  637.     sfx.Delay = 0.15
  638. end)
  639.  
  640. pcall(function()
  641.     local PitchShiftSoundEffect0 = Instance.new("PitchShiftSoundEffect")
  642.     PitchShiftSoundEffect0.Parent = parry
  643.     PitchShiftSoundEffect0.Octave = 1.5
  644. end)
  645.  
  646. local parrystart = Instance.new("Sound")
  647. parrystart.SoundId = "rbxassetid://28166555"
  648. parrystart.Parent = handle
  649.  
  650. local sparkle1 = Instance.new("Sound")
  651. sparkle1.SoundId = "rbxassetid://9126072038"
  652. sparkle1.Parent = handle
  653.  
  654. local sparkle2 = Instance.new("Sound")
  655. sparkle2.SoundId = "rbxassetid://9126073375"
  656. sparkle2.Parent = handle
  657.  
  658. local sparkle3 = Instance.new("Sound")
  659. sparkle3.SoundId = "rbxassetid://9126074225"
  660. sparkle3.Parent = handle
  661.  
  662. local sparkle4 = Instance.new("Sound")
  663. sparkle4.SoundId = "rbxassetid://9126072040"
  664. sparkle4.Parent = handle
  665.  
  666. local sparkles = {sparkle1,sparkle2,sparkle3,sparkle4}
  667. local sparkle_id = 0
  668.  
  669. dodgesound = Instance.new("Sound")
  670. dodgesound.SoundId = "rbxassetid://4340253186"
  671. dodgesound.Parent = handle
  672.  
  673. -- settuo
  674.  
  675. function connect_char()
  676.     if parryprompt then parryprompt:Destroy() end
  677.     if dodgeprompt then dodgeprompt:Destroy() end
  678.     if humdied then humdied:Disconnect() end
  679.     if healthchanged then healthchanged:Disconnect() end
  680.  
  681.     parryprompt = Instance.new("ProximityPrompt")
  682.     parryprompt.Style = Enum.ProximityPromptStyle.Custom
  683.     parryprompt.ClickablePrompt = false
  684.     parryprompt.KeyboardKeyCode = Enum.KeyCode.F
  685.     parryprompt.HoldDuration = 0
  686.     parryprompt.MaxActivationDistance = 0.1
  687.     parryprompt.RequiresLineOfSight = false
  688.     parryprompt.Parent = plr.Character.Head
  689.  
  690.     local function pfx(dmg)
  691.         dmg = dmg or 100
  692.         parryhitConf = true
  693.         parrying = false
  694.         parryparticle(handle, dmg)
  695.         parry.PlaybackSpeed = math.random(95,105)/100
  696.         parry:Play()
  697.         coroutine.wrap(function()
  698.             if math.random(1,2)==1 then
  699.                 parryhit1()
  700.             else
  701.                 parryhit2()
  702.             end
  703.         end)()
  704.     end
  705.  
  706.     local function DescendantAdded(item)
  707.         if item:IsA("Explosion") and currentparry and can_use() then
  708.             item.Hit:Connect(function(obj)
  709.                 if obj:IsDescendantOf(char) then
  710.                     local ff = Instance.new("ForceField")
  711.                     ff.Visible = false
  712.                     ff.Parent = char
  713.                     game:GetService("Debris"):AddItem(ff,1)
  714.                     pfx()
  715.                     table.insert(explosion_ff,ff)
  716.                 end
  717.             end)
  718.         end
  719.     end
  720.  
  721.     local dampening = 1
  722.     local last_health = hum.Health
  723.     workspace.DescendantAdded:Connect(DescendantAdded)
  724.     local healthchanged = char.Humanoid.HealthChanged:Connect(function(new_health)
  725.         --local new_health = hum.Health
  726.         if new_health > 0 and new_health < last_health then
  727.             if currentparry then
  728.                 if can_use() and not stunned then
  729.                     if attacking and not attacked then
  730.                         last_health = hum.Health
  731.                         return
  732.                     end
  733.                 else
  734.                     last_health = hum.Health
  735.                     return
  736.                 end
  737.                 pid += 1
  738.                 local cid = pid
  739.                
  740.                 local damage = last_health - new_health
  741.                 char.Humanoid.Health = last_health + 10 / dampening
  742.                 if 4 >= dampening then
  743.                     dampening += 1
  744.                 end
  745.                
  746.                 parrystart:Play()
  747.                 sparkle_id += 1
  748.                 if sparkle_id >= #sparkles then
  749.                     sparkle_id = 1
  750.                 end
  751.                 sparkles[sparkle_id]:Play()
  752.                
  753.                 pfx(damage)
  754.                
  755.                 task.wait(parry_time)
  756.                 --task.wait(0.2)
  757.  
  758.                 if pid == cid then
  759.                     dampening = 1
  760.                     idle()
  761.                 end
  762.             elseif not currentparry and true == false then
  763.                 if char:FindFirstChild("WeldFolder") then
  764.                 else
  765.                     tool.Parent = char
  766.                 end
  767.                 stunned = true
  768.                 last_stun = os.clock()
  769.                 stunfx(stun_time)
  770.                 local cid = aid
  771.                 repeat
  772.                     task.wait()
  773.                 until os.clock()-last_stun >= stun_time
  774.                 stunned = false
  775.                 idle()
  776.             end
  777.         end
  778.         last_health = hum.Health
  779.     end)
  780.    
  781.     --[[parryprompt.Triggered:Connect(function(who)
  782.         if who ~= plr then return end
  783.         if can_use() and not stunned then
  784.             if attacking and not attacked then
  785.                 return
  786.             end
  787.  
  788.             if currentparry then
  789.                 if not parryhitConf then
  790.                     return
  791.                 end
  792.                 if pc then return end
  793.             end
  794.             ]]
  795.  
  796.             pid += 1
  797.  
  798.             local cid = pid
  799.             currentparry = true
  800.             parryhitConf = false
  801.             plr.Character.Humanoid:SetAttribute("parry",true)
  802.  
  803.             local healthWas = char.Humanoid.Health
  804.             dampening = 1
  805.  
  806.             for i,v in ipairs(explosion_ff) do
  807.                 v:Destroy()
  808.             end
  809.             --[[
  810.             task.wait(parry_time)
  811.  
  812.             if pid == cid then else return end
  813.             currentparry = false
  814.             plr.Character.Humanoid:SetAttribute("parry",nil)
  815.  
  816.             task.wait(.2)
  817.  
  818.             if pid == cid then else return end
  819.  
  820.             idle()
  821.  
  822.             if not parryhitConf then
  823.                 task.wait(.2)
  824.                 if pid == cid then else return end
  825.                 parrying = false
  826.             end
  827.         end
  828.     end)
  829.     ]]
  830.  
  831.     --DODGE----------------------------------------------------------------
  832.  
  833.     dodgeprompt = Instance.new("ProximityPrompt")
  834.     dodgeprompt.Style = Enum.ProximityPromptStyle.Custom
  835.     dodgeprompt.ClickablePrompt = false
  836.     dodgeprompt.KeyboardKeyCode = Enum.KeyCode.Q
  837.     dodgeprompt.HoldDuration = 0
  838.     dodgeprompt.MaxActivationDistance = 0.1
  839.     dodgeprompt.RequiresLineOfSight = false
  840.     dodgeprompt.Parent = plr.Character.Head
  841.     dodgeprompt.Triggered:Connect(function(who)
  842.         if who ~= plr then return end
  843.         if can_use() and not dodging and not stunned then
  844.             dodging = true
  845.             dodgesound:Play()
  846.             local BodyVelocity = Instance.new("BodyVelocity")
  847.             BodyVelocity.Parent = hrp
  848.             BodyVelocity.MaxForce = Vector3.new(80000,80000,80000)
  849.             BodyVelocity.Velocity = hrp.CFrame.LookVector * 65
  850.             game.Debris:AddItem(BodyVelocity, 0.15)
  851.             task.wait(1)
  852.             dodging = false
  853.         end
  854.     end)
  855.  
  856.     local humdied = plr.Character.Humanoid.Died:Connect(function()
  857.         local i = Instance.new("Sound")
  858.         i.SoundId = "rbxassetid://5975689346"
  859.         i.Volume = 1
  860.         i.PlayOnRemove = true
  861.         i.Parent = plr.Character.HumanoidRootPart
  862.         i:Destroy()
  863.     end)
  864. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement