Guest User

Untitled

a guest
May 15th, 2021
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.02 KB | None | 0 0
  1. local rp = game:GetService("ReplicatedStorage")
  2. local combatevent = script.Parent
  3. local animation = script:WaitForChild("Animations")
  4. local acutalplayer = game:GetService("Players")
  5. local CollectionService = game:GetService("CollectionService")
  6. local tweenService = game:GetService("TweenService")
  7. local ALIVE_TAG_NAME = "Punch"
  8. local debounce = false
  9.  
  10.  
  11.  
  12. local anims = {
  13. animation:WaitForChild("Slash1"), --Add more animations here
  14. animation:WaitForChild("Slash2"),
  15. animation:WaitForChild("Slash3"),
  16. animation:WaitForChild("FinalSlash"),
  17.  
  18.  
  19. }
  20.  
  21. combatevent.OnServerEvent:Connect(function(player,count,V1)
  22. print("Recieved event")
  23. local character = player.Character
  24. local Hum = character:WaitForChild("Humanoid")
  25.  
  26. spawn(function()
  27. Hum.WalkSpeed = 10
  28. wait(3)
  29. Hum.WalkSpeed = 16
  30. end)
  31.  
  32.  
  33. local clash = Instance.new("BoolValue")
  34. clash.Name = "ClashAttack"
  35. clash.Value = false
  36. clash.Parent = player.Character
  37. game.Debris:AddItem(clash,0.4)
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. local dodge = {6749709098,6749706131,6749707668} --paste animation id here
  46. local num = math.random(#dodge)
  47. local chosenanim = dodge[num]
  48.  
  49.  
  50.  
  51.  
  52. local attack = Hum:LoadAnimation(anims[count])
  53. attack:Play()
  54.  
  55. combatevent:FireClient(player)
  56.  
  57. local hiteffectball = function(target,pos)
  58.  
  59. local hiteffect = game.ReplicatedStorage.SwordCombat.Thing:Clone()
  60. hiteffect.CFrame = pos
  61. hiteffect.CFrame = CFrame.new(hiteffect.Position, target.Position)
  62. hiteffect.Parent = target
  63. game.Debris:AddItem(hiteffect,1)
  64.  
  65.  
  66.  
  67. if count == 4 then
  68. hiteffect.BrickColor = BrickColor.new("Neon orange")
  69. end
  70.  
  71. tweenService:Create(hiteffect,TweenInfo.new(0.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{CFrame = hiteffect.CFrame + hiteffect.CFrame.lookVector * -7,Transparency = 1,Size = Vector3.new(0.087, 0.08, 3.35)}):Play()
  72.  
  73. end
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80. local region = Region3.new(V1-Vector3.new(2,2,2),V1+Vector3.new(2,2,2))
  81. local RTable = workspace:FindPartsInRegion3(region,nil,20)
  82.  
  83. for i,v in pairs(RTable) do
  84. if v.Parent:FindFirstChild("Humanoid") and v.Parent:FindFirstChild("Deb") == nil and v.Parent ~= character then
  85. local deb = Instance.new("BoolValue",v.Parent)
  86. deb.Name = "Deb"
  87. game.Debris:AddItem(deb,0.2)
  88. local closecharacter = v.Parent
  89.  
  90. if closecharacter:FindFirstChild("Knocked") then return end
  91.  
  92.  
  93. if closecharacter.HumanoidRootPart:FindFirstChild("Block") then
  94. if (closecharacter.HumanoidRootPart.Position - character.HumanoidRootPart.Position).Magnitude < 3.5 then
  95. print("someone is blocking near u")
  96.  
  97.  
  98. local hiteffect = game.ReplicatedStorage.SwordCombat:WaitForChild("HitCollision"):Clone()
  99. hiteffect.CFrame = closecharacter.HumanoidRootPart.CFrame
  100. hiteffect.Parent = workspace
  101. game.Debris:AddItem(hiteffect,0.6)
  102.  
  103. local Sound = Instance.new("Sound")
  104. Sound.SoundId = "rbxassetid://5763723309"
  105. Sound.Parent = closecharacter.HumanoidRootPart
  106. Sound.PlaybackSpeed = math.random(93,107)/100
  107. Sound:Play()
  108. game.Debris:AddItem(Sound,0.5)
  109.  
  110.  
  111. local info3 = TweenInfo.new(0.5,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
  112. local goal3 = {}
  113. goal3.Size = hiteffect.Size * 12
  114. goal3.Transparency = 1
  115. local tween3 = tweenService:Create(hiteffect,info3,goal3)
  116. tween3:Play()
  117. print("played3")
  118.  
  119. -- hes blocking
  120. if count == 4 then
  121. closecharacter.BlockBar.Value = closecharacter.BlockBar.Value - 100
  122. print("block broken")
  123.  
  124.  
  125. local bv = Instance.new("BodyVelocity",closecharacter.HumanoidRootPart)
  126. bv.MaxForce = Vector3.new(1e8,1e8,1e8)
  127. bv.Velocity = character.HumanoidRootPart.CFrame.lookVector*20
  128. game.Debris:AddItem(bv,0.3)
  129. print("knock him back")
  130. end
  131.  
  132.  
  133.  
  134. else
  135. -- your behind him
  136. if (closecharacter.HumanoidRootPart.Position - character.HumanoidRootPart.Position).Magnitude < 7 then
  137. print("hitting from behind")
  138. closecharacter.Humanoid:TakeDamage(7)
  139.  
  140.  
  141.  
  142. local hitvalue = Instance.new("BoolValue")
  143. hitvalue.Name = "Hit"
  144. hitvalue.Parent = closecharacter
  145. game.Debris:AddItem(hitvalue,1)
  146.  
  147.  
  148.  
  149. local times = 0
  150.  
  151.  
  152.  
  153.  
  154. local hiteffect = game.ReplicatedStorage.SwordCombat:WaitForChild("SlashEffect"):Clone()
  155. hiteffect.CFrame = closecharacter.HumanoidRootPart.CFrame * CFrame.Angles(math.rad(-1.38),math.rad(177.92),math.rad(-123.57))
  156. hiteffect.Parent = workspace
  157. game.Debris:AddItem(hiteffect,0.5)
  158.  
  159.  
  160. local info3 = TweenInfo.new(0.3,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
  161. local goal3 = {}
  162. goal3.Size = hiteffect.Size * 3
  163. goal3.Transparency = 1
  164. local tween3 = tweenService:Create(hiteffect,info3,goal3)
  165. tween3:Play()
  166. print("played3")
  167. print("you both hit at the same time")
  168.  
  169.  
  170. local Sound = Instance.new("Sound")
  171. Sound.SoundId = "rbxassetid://935843979"
  172. Sound.Parent = closecharacter.HumanoidRootPart
  173. Sound.PlaybackSpeed = math.random(93,107)/100
  174. Sound:Play()
  175. game.Debris:AddItem(Sound,0.5)
  176.  
  177.  
  178. if count == 4 then
  179.  
  180.  
  181. local Track11= Instance.new("Animation")
  182. Track11.AnimationId = "rbxassetid://5402391192"
  183. local Anim11 = closecharacter.Humanoid:LoadAnimation(Track11)
  184. Anim11:Play()
  185.  
  186. local bv = Instance.new("BodyVelocity",closecharacter.HumanoidRootPart)
  187. bv.MaxForce = Vector3.new(1e8,1e8,1e8)
  188. bv.Velocity = character.HumanoidRootPart.CFrame.lookVector*30
  189. game.Debris:AddItem(bv,0.3)
  190. Anim11:Stop()
  191.  
  192.  
  193. local Sound = Instance.new("Sound")
  194. Sound.SoundId = "rbxassetid://3932506183"
  195. Sound.Parent = closecharacter.HumanoidRootPart
  196. Sound.PlaybackSpeed = math.random(93,107)/100
  197. Sound:Play()
  198. game.Debris:AddItem(Sound,0.5)
  199.  
  200. end
  201.  
  202. spawn(function()
  203. closecharacter.Humanoid.WalkSpeed = 1
  204. closecharacter.Humanoid.JumpPower = 1
  205. wait(1.7)
  206. closecharacter.Humanoid.WalkSpeed = 16
  207. closecharacter.Humanoid.JumpPower = 50
  208.  
  209. end)
  210.  
  211.  
  212.  
  213.  
  214. end
  215.  
  216.  
  217. end
  218.  
  219.  
  220.  
  221. else
  222. -- HAS HAKI ON
  223. if closecharacter:FindFirstChild("HasHaki") then
  224. print("he has haki on")
  225.  
  226. local closeplayer = game.Players:GetPlayerFromCharacter(closecharacter)
  227. if closeplayer.Data.HakiLevel.Value >0 then
  228.  
  229. spawn(function()
  230. if not debounce then
  231. debounce = true
  232. closeplayer.Data.HakiLevel.Value = closeplayer.Data.HakiLevel.Value - 1
  233. wait(0.6)
  234. debounce = false
  235. print("REMOVED ONE VALUE")
  236. end
  237. end)
  238.  
  239. spawn(function()
  240. local track = Instance.new("Animation")
  241. track.AnimationId = "rbxassetid://"..chosenanim
  242. local anim = closecharacter.Humanoid:LoadAnimation(track)
  243. anim:Play()
  244. wait(0.3)
  245. anim:Stop()
  246.  
  247.  
  248. end)
  249.  
  250. end
  251. else
  252. -- CLASHING
  253. if closecharacter:FindFirstChild("ClashAttack") then
  254. local sound = Instance.new("Sound")
  255. sound.SoundId = "rbxassetid://182707266"
  256. sound.Parent = closecharacter.HumanoidRootPart
  257. sound:Play()
  258. game.Debris:AddItem(sound,0.5)
  259. print("SOUND TESTINGG")
  260.  
  261. local hiteffect = game.ReplicatedStorage.SwordCombat:WaitForChild("HitCollision"):Clone()
  262. hiteffect.CFrame = closecharacter.HumanoidRootPart.CFrame
  263. hiteffect.BrickColor = BrickColor.new("Daisy orange")
  264. hiteffect.Parent = workspace
  265. game.Debris:AddItem(hiteffect,0.6)
  266.  
  267. local info3 = TweenInfo.new(0.5,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
  268. local goal3 = {}
  269. goal3.Size = hiteffect.Size * 16
  270. goal3.Transparency = 1
  271. local tween3 = tweenService:Create(hiteffect,info3,goal3)
  272. tween3:Play()
  273. print("played3")
  274. print("you both hit at the same time")
  275.  
  276. local Track11= Instance.new("Animation")
  277. Track11.AnimationId = "rbxassetid://5402391192"
  278. local Anim11 = closecharacter.Humanoid:LoadAnimation(Track11)
  279. Anim11:Play()
  280.  
  281. local bv = Instance.new("BodyVelocity",closecharacter.HumanoidRootPart)
  282. bv.MaxForce = Vector3.new(1e8,1e8,1e8)
  283. bv.Velocity = character.HumanoidRootPart.CFrame.lookVector*60
  284. game.Debris:AddItem(bv,0.3)
  285. Anim11:Stop()
  286.  
  287. local Track12= Instance.new("Animation")
  288. Track12.AnimationId = "rbxassetid://5402391192"
  289. local Anim12 = character.Humanoid:LoadAnimation(Track12)
  290. Anim12:Play()
  291.  
  292. local bv2 = Instance.new("BodyVelocity",character.HumanoidRootPart)
  293. bv2.MaxForce = Vector3.new(1e8,1e8,1e8)
  294. bv2.Velocity = character.HumanoidRootPart.CFrame.lookVector*-60
  295. game.Debris:AddItem(bv2,0.3)
  296. Anim12:Stop()
  297.  
  298. else
  299.  
  300.  
  301. -- not blocking at all
  302. closecharacter.Humanoid:TakeDamage(7)
  303. print("IF THIS PRINTS")
  304.  
  305.  
  306. local times = 0
  307.  
  308.  
  309.  
  310.  
  311. local hitvalue = Instance.new("BoolValue")
  312. hitvalue.Name = "Hit"
  313. hitvalue.Parent = closecharacter
  314. game.Debris:AddItem(hitvalue,1)
  315.  
  316.  
  317. local hiteffect = game.ReplicatedStorage.SwordCombat:WaitForChild("SlashEffect"):Clone()
  318. hiteffect.CFrame = closecharacter.HumanoidRootPart.CFrame * CFrame.Angles(math.rad(-1.38),math.rad(177.92),math.rad(-123.57))
  319. hiteffect.Parent = workspace
  320. game.Debris:AddItem(hiteffect,0.5)
  321.  
  322.  
  323. local info3 = TweenInfo.new(0.3,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
  324. local goal3 = {}
  325. goal3.Size = hiteffect.Size * 3
  326. goal3.Transparency = 1
  327. local tween3 = tweenService:Create(hiteffect,info3,goal3)
  328. tween3:Play()
  329. print("played3")
  330. print("you both hit at the same time")
  331.  
  332.  
  333.  
  334. local Sound = Instance.new("Sound")
  335. Sound.SoundId = "rbxassetid://935843979"
  336. Sound.Parent = closecharacter.HumanoidRootPart
  337. Sound.PlaybackSpeed = math.random(93,107)/100
  338. Sound:Play()
  339. game.Debris:AddItem(Sound,0.5)
  340.  
  341.  
  342.  
  343. if count == 4 then
  344.  
  345.  
  346. local Track11= Instance.new("Animation")
  347. Track11.AnimationId = "rbxassetid://5402391192"
  348. local Anim11 = closecharacter.Humanoid:LoadAnimation(Track11)
  349. Anim11:Play()
  350.  
  351. local bv = Instance.new("BodyVelocity",closecharacter.HumanoidRootPart)
  352. bv.MaxForce = Vector3.new(1e8,1e8,1e8)
  353. bv.Velocity = character.HumanoidRootPart.CFrame.lookVector*30
  354. game.Debris:AddItem(bv,0.3)
  355. Anim11:Stop()
  356.  
  357.  
  358. local sound = Instance.new("Sound")
  359. sound.SoundId = "rbxassetid://4810749120"
  360. sound.Parent = closecharacter.HumanoidRootPart
  361. sound.PlaybackSpeed = math.random(93,107)/100
  362. sound:Play()
  363. game.Debris:AddItem(sound,3)
  364.  
  365. end
  366.  
  367.  
  368.  
  369.  
  370. spawn(function()
  371. closecharacter.Humanoid.WalkSpeed = 1
  372. closecharacter.Humanoid.JumpPower = 1
  373. wait(1.7)
  374. closecharacter.Humanoid.WalkSpeed = 16
  375. closecharacter.Humanoid.JumpPower = 50
  376.  
  377. end)
  378. end
  379.  
  380. end
  381. end
  382. end
  383. end
  384.  
  385.  
  386.  
  387.  
  388. end)
Advertisement
Add Comment
Please, Sign In to add comment