Molodejkaoff

Untitled

Aug 22nd, 2021
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.38 KB | None | 0 0
  1.  
  2. local Knock = {}
  3. local ServerScriptService = game:GetService("ServerScriptService")
  4. local Cooldown_M = require(ServerScriptService["Cooldown"]);
  5.  
  6.  
  7.  
  8. local Glue = function(name, part1, part2, c0, c1)
  9. local gloo = Instance.new("Glue")
  10. gloo.Name = name
  11. gloo.C0 = c0
  12. gloo.C1 = c1
  13. gloo.Part0 = part1
  14. gloo.Part1 = part2
  15. gloo.Parent = part1
  16. end
  17.  
  18.  
  19. local Motor = function(name, part1, part2, c0, c1)
  20. local motor = Instance.new("Motor6D")
  21. motor.Name = name
  22. motor.C0 = c0
  23. motor.C1 = c1
  24. motor.Part0 = part1
  25. motor.Part1 = part2
  26. motor.Parent = part1
  27. end
  28.  
  29.  
  30. local Touchy = function(parent)
  31. local pr = Instance.new("Part")
  32. pr.Name = "Touchy"
  33. pr.Size = Vector3.new(1 * 1, 1 * 1, 1 * 1)
  34. pr.Transparency = 1
  35. pr.Massless = true
  36. pr.CustomPhysicalProperties = PhysicalProperties.new(0.55, 0.3, 0.5)
  37. pr.CanCollide = true
  38. pr.Anchored = false
  39. pr.Parent = parent
  40. local w = Instance.new("Weld")
  41. w.Part0 = pr
  42. w.Part1 = parent
  43. w.C0 = CFrame.new(0, 0.5, 0)
  44. w.Parent = pr
  45. end
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. local Get_Parts = function(player)
  54. local Character = player.Character
  55. return {
  56. ["Character"] = Character,
  57. ["Humanoid"] = Character["Humanoid"],
  58. ["Torso"] = Character["Torso"],
  59. ["RARM"] = Character["Right Arm"],
  60. ["LARM"] = Character["Left Arm"],
  61. ["RLEG"] = Character["Right Leg"],
  62. ["LLEG"] = Character["Left Leg"],
  63. ["HRP"] = Character["HumanoidRootPart"],
  64. ["Head"] = Character["Head"]
  65. }
  66. end
  67.  
  68.  
  69. local Positions = {
  70. ["Knock"] = {
  71. ["RightShoulderC0"] = CFrame.new(1.5 * 1, 0.5 * 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  72. ["RightShoulderC1"] = CFrame.new(0, 0.5 * 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  73. ["LeftShoulderC0"] = CFrame.new(-1.5 * 1, 0.5 * 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
  74. ["LeftShoulderC1"] = CFrame.new(0, 0.5 * 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
  75. ["RightHipC0"] = CFrame.new(0.5 * 1, -1 * 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  76. ["RightHipC1"] = CFrame.new(0, 1 * 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  77. ["LeftHipC0"] = CFrame.new(-0.5 * 1, -1 * 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
  78. ["LeftHipC1"] = CFrame.new(0 * 1, 1 * 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
  79. },
  80. ["GetUp"] = {
  81. ["RightShoulderC0"] = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  82. ["RightShoulderC1"] = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  83. ["LeftShoulderC0"] = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
  84. ["LeftShoulderC1"] = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
  85. ["RightHipC0"] = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  86. ["RightHipC1"] = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  87. ["LeftHipC0"] = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
  88. ["LeftHipC1"] = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
  89. }
  90.  
  91. }
  92.  
  93.  
  94. local MotorSystem = function(Character, Choice)
  95. return {
  96. ["Right Shoulder"] = {
  97. ["Limb"] = Character["RARM"],
  98. ["C"] = {
  99. Positions[Choice]["RightShoulderC0"],
  100. Positions[Choice]["RightShoulderC1"]
  101. }
  102. },
  103. ["Left Shoulder"] = {
  104. ["Limb"] = Character["LARM"],
  105. ["C"] = {
  106. Positions[Choice]["LeftShoulderC0"],
  107. Positions[Choice]["LeftShoulderC1"]
  108. }
  109. },
  110. ["Right Hip"] = {
  111. ["Limb"] = Character["RLEG"],
  112. ["C"] = {
  113. Positions[Choice]["RightHipC0"],
  114. Positions[Choice]["RightHipC1"]
  115. }
  116. },
  117. ["Left Hip"] = {
  118. ["Limb"] = Character["LLEG"],
  119. ["C"] = {
  120. Positions[Choice]["LeftHipC0"],
  121. Positions[Choice]["LeftHipC1"]
  122. }
  123. },
  124. }
  125. end
  126.  
  127.  
  128. local Knocked = function(player)
  129. local Character = Get_Parts(player)
  130.  
  131. Character["Humanoid"].PlatformStand = true
  132. local Motors = MotorSystem(Character,"Knock")
  133. for i, v in next, Motors do
  134. coroutine.resume(coroutine.create(function()
  135. if Character["Torso"]:FindFirstChild(i) then
  136. Character["Torso"]:FindFirstChild(i):Destroy()
  137. Glue(i, Character["Torso"], Motors[i]["Limb"], unpack(Motors[i]['C']))
  138. Touchy(Motors[i]["Limb"])
  139. end
  140. end))
  141. end
  142. end
  143.  
  144.  
  145. local GetUp = function(player)
  146. local Character = Get_Parts(player)
  147.  
  148. Character["Humanoid"].PlatformStand = false
  149. Character["Humanoid"].Jump = true
  150.  
  151. local Motors = MotorSystem(Character,"GetUp")
  152. for i, v in next, Motors do
  153. coroutine.resume(coroutine.create(function()
  154. if Character["Torso"]:FindFirstChild(i) then
  155. Character["Torso"]:FindFirstChild(i):Destroy()
  156. Motor(i, Character["Torso"], Motors[i]["Limb"], unpack(Motors[i]['C']))
  157. Motors[i]["Limb"]:FindFirstChild("Touchy"):Destroy()
  158. end
  159. end))
  160. end
  161. end
  162.  
  163. function Knock:Knock(lplayer, tplayer, skill , cooldown)
  164.  
  165. local LocalPlayer = lplayer
  166. local Target = tplayer
  167. local Backpack = Target.Backpack["Data"]
  168. local Blocked = Backpack.Block.Value
  169. local Deflected = Backpack.Deflect.Value
  170. local Dodged = Backpack.Dodge.Value
  171. local IsTS = game.Lighting.TS.Value
  172. local knocked;
  173.  
  174.  
  175. if Deflected then
  176. repeat
  177. wait()
  178. until not game.Lighting.TS.Value
  179. Knocked(LocalPlayer)
  180. knocked = LocalPlayer
  181. elseif Dodged then
  182. elseif not Deflected then
  183. repeat
  184. wait()
  185. until not game.Lighting.TS.Value
  186. Knocked(Target)
  187. knocked = Target
  188. end
  189.  
  190. game:GetService("ReplicatedStorage").Knocked:FireClient(knocked,cooldown)
  191.  
  192. Cooldown_M:AddCooldown(knocked,skill,cooldown)
  193.  
  194.  
  195.  
  196. while wait() do
  197. if not Cooldown_M:CheckCooldown(knocked, skill) or knocked.Character["Humanoid"].Health < 1 then
  198. GetUp(knocked)
  199. print("Knock Cooldown is done")
  200. break;
  201. end
  202. end
  203. end
  204.  
  205.  
  206.  
  207. return Knock
Add Comment
Please, Sign In to add comment