Advertisement
IHATEMICROWAVEOVEN

iron head

Oct 15th, 2023
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.88 KB | None | 0 0
  1. client
  2. client
  3. client
  4. client
  5. client
  6. -- SETTINGS
  7. local reload = 4
  8. local name = "KowtowCleave"
  9. -- SCRIPT
  10. local debounce = true
  11. function Use(plr, device, CS, CWS)
  12. if debounce then
  13. debounce = false
  14. CWS("RunWeapon", name)
  15. task.wait(0.5)
  16. debounce = true
  17. end
  18. end
  19.  
  20. return {Use, reload}
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. server
  34. server
  35. server
  36. server
  37. server
  38. local initWindmill = game:WaitForChild("ServerStorage"):WaitForChild("Items").SlicedWindmill
  39. local innerDashColor = Color3.fromRGB(208, 73, 73)
  40. local innerDashTrans = 0.5
  41. local outerDashColor = Color3.fromRGB(27, 42, 53)
  42. local outerDashTrans = 0.7
  43.  
  44. local dashDistance = 80
  45. local hitboxWidth = 14 -- Hitbox length across
  46. local hitboxHeight = 9 -- Hitbox height upwards
  47. local hitboxSphere = 20 -- Diameter of a sphere formed at the beginning and ending of the cleave
  48. local DMG = 80
  49. local windup = 2.2
  50. local windmillDespawnTimer = 7
  51.  
  52. local RunService = game:GetService("RunService")
  53. local DamageService = require(game:GetService("ServerScriptService"):WaitForChild("Libraries").DamageService)
  54.  
  55.  
  56. local function Raycast(pos, direction, params)
  57. local castResult = workspace:Raycast(pos, direction, params)
  58. if castResult and castResult.Instance.CanCollide==false then
  59. table.insert(params.FilterDescendantsInstances, castResult.Instance)
  60. local newDirection = castResult.Position-pos
  61. return Raycast(pos, newDirection.Unit*(direction.Magnitude-castResult.Distance), params)
  62. else
  63. return castResult
  64. end
  65. end
  66.  
  67. local function Use(...)
  68. local args = {...}
  69. local character = args[1].Character
  70. local root = character.Torso
  71. local humanoid = character.Humanoid
  72.  
  73. local windmill = initWindmill:Clone()
  74. local wmLower, wmUpper = windmill.Lower, windmill.Upper
  75. wmLower.Anchored, wmLower.CanCollide, wmLower.Massless, wmUpper.Anchored, wmUpper.CanCollide, wmUpper.Massless =
  76. false, false, true, false, false, true
  77. wmLower.CFrame, wmUpper.CFrame = root.CFrame*CFrame.new(0, -0.7, -8), root.CFrame*CFrame.new(0, 1.605, -8)
  78. windmill.Parent=workspace
  79. local wmWeld = Instance.new("Weld")
  80. wmWeld.Part0, wmWeld.Part1, wmWeld.C0, wmWeld.Name =
  81. root, wmLower, CFrame.new(0, -0.7, -8), "Weld"
  82. wmWeld.Parent = wmLower
  83. wmWeld = Instance.new("Weld")
  84. wmWeld.Part0, wmWeld.Part1, wmWeld.C0, wmWeld.Name =
  85. root, wmUpper, CFrame.new(0, 1.605, -8.203), "Weld"
  86. wmWeld.Parent = wmUpper
  87.  
  88. task.wait(windup)
  89.  
  90.  
  91. wmLower.Anchored, wmLower.CanCollide, wmUpper.Massless, wmUpper.CanCollide = true, true, false, true
  92. local wmMass = wmUpper:GetMass()
  93. if wmLower:FindFirstChild("Weld") and wmUpper:FindFirstChild("Weld") then
  94. wmLower.Weld:Destroy()
  95. wmUpper.Weld:Destroy()
  96. wmUpper:ApplyImpulse(Vector3.new(wmMass*math.random(-20, 20), wmMass*math.random(50, 80), wmMass*math.random(-20, 0)))
  97. wmUpper:ApplyAngularImpulse(Vector3.new(wmMass*math.random(-360, 360), wmMass*math.random(-360, 360), wmMass*math.random(-360, 360)))
  98. coroutine.wrap(function()
  99. task.wait(windmillDespawnTimer)
  100. wmUpper:Destroy()
  101. wmLower:Destroy()
  102. end)()
  103. else
  104. wmUpper:Destroy()
  105. wmLower:Destroy()
  106. end
  107.  
  108. task.wait(0.1)
  109.  
  110. local plrSaveCF = root.CFrame
  111. local targetParams = RaycastParams.new()
  112. targetParams.CollisionGroup, targetParams.FilterType, targetParams.FilterDescendantsInstances = "Default", Enum.RaycastFilterType.Exclude, {character, windmill}
  113. local targetCast = Raycast(root.Position, plrSaveCF.lookVector*dashDistance, targetParams)
  114. local targetHit = targetCast and targetCast.Position or (plrSaveCF*CFrame.new(0, 0, -dashDistance)).Position
  115. root.CFrame=CFrame.lookAt(targetHit, targetHit+plrSaveCF.lookVector)
  116.  
  117.  
  118. local midpoint = (targetHit+plrSaveCF.Position)/2
  119. local dist = (targetHit-plrSaveCF.Position).Magnitude
  120. local innerTrail = Instance.new("Part")
  121. innerTrail.Anchored, innerTrail.CanCollide, innerTrail.Material, innerTrail.Size, innerTrail.CFrame, innerTrail.Color, innerTrail.Transparency =
  122. true, false, "Neon", Vector3.new(0.5, 0.5, dist), CFrame.lookAt(midpoint, targetHit), innerDashColor, innerDashTrans
  123. local mesh = Instance.new("SpecialMesh")
  124. mesh.MeshType = Enum.MeshType.Sphere
  125. mesh.Parent = innerTrail
  126. innerTrail.Parent = workspace
  127. local outerTrail = Instance.new("Part")
  128. outerTrail.Anchored, outerTrail.CanCollide, outerTrail.Material, outerTrail.Size, outerTrail.CFrame, outerTrail.Color, outerTrail.Transparency =
  129. true, false, "Neon", Vector3.new(1.5, 1.5, dist+1), CFrame.lookAt(midpoint, targetHit), outerDashColor, outerDashTrans
  130. mesh = Instance.new("SpecialMesh")
  131. mesh.MeshType = Enum.MeshType.Sphere
  132. mesh.Parent = outerTrail
  133.  
  134. local sparkles = Instance.new("ParticleEmitter")
  135. sparkles.Color, sparkles.Lifetime, sparkles.Rate, sparkles.SpreadAngle, sparkles.Speed =
  136. ColorSequence.new(innerDashColor), NumberRange.new(0.5, 0.8), 0, Vector2.new(360, 360), NumberRange.new(8, 12)
  137. sparkles.Parent = outerTrail
  138. outerTrail.Parent = workspace
  139.  
  140. local slashHitbox = Instance.new("Part")
  141. slashHitbox.CanCollide, slashHitbox.Transparency, slashHitbox.Size, slashHitbox.CFrame =
  142. false, 1, Vector3.new(hitboxWidth, hitboxHeight, dist), CFrame.lookAt(midpoint, targetHit)
  143. slashHitbox.Parent = workspace
  144. local startHitbox = Instance.new("Part")
  145. startHitbox.CanCollide, startHitbox.Transparency, startHitbox.Shape, startHitbox.Size, startHitbox.Position =
  146. false, 1, Enum.PartType.Ball, Vector3.new(hitboxSphere, hitboxSphere, hitboxSphere), plrSaveCF.Position
  147. startHitbox.Parent = workspace
  148. local endHitbox = Instance.new("Part")
  149. endHitbox.CanCollide, endHitbox.Transparency, endHitbox.Shape, endHitbox.Size, endHitbox.Position =
  150. false, 1, Enum.PartType.Ball, Vector3.new(hitboxSphere, hitboxSphere, hitboxSphere), targetHit
  151. endHitbox.Parent = workspace
  152. local hbBodyV = Instance.new("BodyVelocity")
  153. hbBodyV.Velocity, hbBodyV.MaxForce = Vector3.new(0, 0.1, 0), Vector3.new(math.huge, math.huge, math.huge)
  154. hbBodyV.Parent = slashHitbox
  155. hbBodyV = Instance.new("BodyVelocity")
  156. hbBodyV.Velocity, hbBodyV.MaxForce = Vector3.new(0, 0.1, 0), Vector3.new(math.huge, math.huge, math.huge)
  157. hbBodyV.Parent = startHitbox
  158. hbBodyV = Instance.new("BodyVelocity")
  159. hbBodyV.Velocity, hbBodyV.MaxForce = Vector3.new(0, 0.1, 0), Vector3.new(math.huge, math.huge, math.huge)
  160. hbBodyV.Parent = endHitbox
  161. DamageService:RegisterWeaponPart(args[1], {slashHitbox, startHitbox, endHitbox, outerTrail}, DMG)
  162.  
  163. coroutine.wrap(function() -- I much prefer this approach to maintain sync between the two trails
  164. local inInc, outInc, sizeInc = (1-innerDashTrans)/40, (1-outerDashTrans)/40, Vector3.new(1/40, 1/40, 0)
  165. task.wait(0.1)
  166. sparkles:Emit(18)
  167. for i=1,40 do
  168. innerTrail.Transparency+=inInc
  169. innerTrail.Size+=sizeInc
  170. outerTrail.Transparency+=outInc
  171. outerTrail.Size+=sizeInc
  172. task.wait(1/60)
  173. if i==5 then slashHitbox:Destroy() startHitbox:Destroy() endHitbox:Destroy() end
  174. end
  175. innerTrail:Destroy() outerTrail:Destroy() sparkles:Destroy()
  176. end)()
  177. end
  178.  
  179. return Use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement