Advertisement
REDPlays

jojo barrage script

Apr 25th, 2020
6,712
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.53 KB | None | 0 0
  1. local rp = game:GetService("ReplicatedStorage")
  2. local Barrage = rp:WaitForChild("Stand1Remotes"):WaitForChild("BarrageHold")
  3. local TweenService = game:GetService("TweenService")
  4. local Debris = game:GetService("Debris")
  5.  
  6. local Damage = 3
  7. local duration = 3
  8. local debounce = false
  9.  
  10. function recall(Player, HumanoidRP, Stand, Folder)
  11. Folder:Destroy()
  12.  
  13. local prevWeld = Stand:WaitForChild("HumanoidRootPart"):WaitForChild("Stand Weld")
  14. prevWeld:Destroy()
  15.  
  16. Stand:WaitForChild("HumanoidRootPart").CFrame = HumanoidRP.CFrame * CFrame.new(2,0,2)
  17.  
  18. local weld = Instance.new("ManualWeld")
  19. weld.Name = "Stand Weld"
  20. weld.Part0 = Stand:WaitForChild("HumanoidRootPart")
  21. weld.Part1 = HumanoidRP
  22. weld.C0 = Stand:WaitForChild("HumanoidRootPart").CFrame:inverse() * HumanoidRP.CFrame
  23. weld.Parent = weld.Part0
  24.  
  25. local animControl = Stand:WaitForChild("AnimControl")
  26. for i, track in pairs(animControl:GetPlayingAnimationTracks()) do
  27. track:Stop()
  28. end
  29.  
  30. local Idle = animControl:LoadAnimation(script:WaitForChild("Idle"))
  31. Idle:Play()
  32. end
  33.  
  34. Barrage.OnServerEvent:Connect(function(Player,active)
  35. local Stand = workspace:FindFirstChild(Player.Name.." Stand"):FindFirstChild("Dummy")
  36.  
  37. if Stand and active == false then
  38. debounce = true
  39. local Character = Player.Character
  40. local Humanoid = Character:WaitForChild("Humanoid")
  41. local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
  42. Humanoid.WalkSpeed = 2
  43. Humanoid.JumpPower = 0
  44.  
  45. local prevWeld = Stand:WaitForChild("HumanoidRootPart"):WaitForChild("Stand Weld")
  46. prevWeld:Destroy()
  47.  
  48. Stand:WaitForChild("HumanoidRootPart").CFrame = HumanoidRP.CFrame * CFrame.new(0,0,-2.5)
  49.  
  50. local weld = Instance.new("ManualWeld")
  51. weld.Name = "Stand Weld"
  52. weld.Part0 = Stand:WaitForChild("HumanoidRootPart")
  53. weld.Part1 = HumanoidRP
  54. weld.C0 = Stand:WaitForChild("HumanoidRootPart").CFrame:inverse() * HumanoidRP.CFrame
  55. weld.Parent = weld.Part0
  56.  
  57. local animControl = Stand:WaitForChild("AnimControl")
  58. for i, track in pairs(animControl:GetPlayingAnimationTracks()) do
  59. track:Stop()
  60. end
  61.  
  62. local Punching = animControl:LoadAnimation(script:WaitForChild("Punches"))
  63. Punching:Play()
  64.  
  65. local Folder = Instance.new("Folder",workspace)
  66. Folder.Name = Player.Name.." Barrage"
  67.  
  68. spawn(function()
  69. wait(duration)
  70. if debounce == true then
  71. debounce = false
  72. Humanoid.WalkSpeed = 16
  73. Humanoid.JumpPower = 50
  74.  
  75. recall(Player, HumanoidRP, Stand, Folder)
  76.  
  77. Barrage:FireClient(Player)
  78. end
  79. end)
  80.  
  81. while wait() and debounce == true do
  82. local ray = Ray.new(Stand:WaitForChild("HumanoidRootPart").CFrame.p + Vector3.new(math.random(-2,2),math.random(-1,1),math.random(-2,2)),Stand:WaitForChild("HumanoidRootPart").CFrame.lookVector * 2)
  83. local hit, pos = workspace:FindPartOnRayWithIgnoreList(ray,{Character,Stand,Folder})
  84.  
  85. if hit then
  86. local EHumanoid = hit.Parent:FindFirstChild("Humanoid")
  87.  
  88. if EHumanoid and EHumanoid.Health > 0 and not EHumanoid:FindFirstChild("BarDeb") then
  89. local BarDeb = Instance.new("BoolValue",EHumanoid)
  90. BarDeb.Name = "BarDeb"
  91. Debris:AddItem(BarDeb,.1)
  92.  
  93. EHumanoid:TakeDamage(Damage)
  94.  
  95. local sound = Instance.new("Sound",Folder)
  96. sound.SoundId = "rbxassetid://2174934844"
  97. sound.Volume = 1
  98. sound:Play()
  99. Debris:AddItem(sound,.5)
  100.  
  101. local wave = script:WaitForChild("Wave"):Clone()
  102. wave.Parent = Folder
  103. wave.CFrame = hit.CFrame
  104. wave.Orientation = wave.Orientation + Vector3.new(90,0,0)
  105. Debris:AddItem(wave,.25)
  106.  
  107. local goal = {}
  108. goal.Size = wave.Size + Vector3.new(5,0,5)
  109. goal.Transparency = wave.Transparency + (1 - wave.Transparency)
  110. local info = TweenInfo.new(.25)
  111. local tween = TweenService:Create(wave,info,goal)
  112. tween:Play()
  113.  
  114. end
  115. end
  116. end
  117.  
  118. end
  119. end)
  120.  
  121. Barrage.OnServerEvent:Connect(function(Player,active)
  122. local Stand = workspace:FindFirstChild(Player.Name.." Stand"):WaitForChild("Dummy")
  123.  
  124. if Stand and active == true then
  125.  
  126. if workspace:FindFirstChild(Player.Name.." Barrage") and debounce == true then
  127. debounce = false
  128. local Character = Player.Character
  129. local Humanoid = Character:WaitForChild("Humanoid")
  130. local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
  131. Humanoid.WalkSpeed = 16
  132. Humanoid.JumpPower = 50
  133.  
  134. local Folder = workspace:FindFirstChild(Player.Name.." Barrage")
  135.  
  136. recall(Player, HumanoidRP, Stand, Folder)
  137.  
  138. Barrage:FireClient(Player)
  139. end
  140.  
  141. end
  142. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement