Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- client
- client
- client
- client
- client
- -- SETTINGS
- local reload = 4
- local name = "KowtowCleave"
- -- SCRIPT
- local debounce = true
- function Use(plr, device, CS, CWS)
- if debounce then
- debounce = false
- CWS("RunWeapon", name)
- task.wait(0.5)
- debounce = true
- end
- end
- return {Use, reload}
- server
- server
- server
- server
- server
- local initWindmill = game:WaitForChild("ServerStorage"):WaitForChild("Items").SlicedWindmill
- local innerDashColor = Color3.fromRGB(208, 73, 73)
- local innerDashTrans = 0.5
- local outerDashColor = Color3.fromRGB(27, 42, 53)
- local outerDashTrans = 0.7
- local dashDistance = 80
- local hitboxWidth = 14 -- Hitbox length across
- local hitboxHeight = 9 -- Hitbox height upwards
- local hitboxSphere = 20 -- Diameter of a sphere formed at the beginning and ending of the cleave
- local DMG = 80
- local windup = 2.2
- local windmillDespawnTimer = 7
- local RunService = game:GetService("RunService")
- local DamageService = require(game:GetService("ServerScriptService"):WaitForChild("Libraries").DamageService)
- local function Raycast(pos, direction, params)
- local castResult = workspace:Raycast(pos, direction, params)
- if castResult and castResult.Instance.CanCollide==false then
- table.insert(params.FilterDescendantsInstances, castResult.Instance)
- local newDirection = castResult.Position-pos
- return Raycast(pos, newDirection.Unit*(direction.Magnitude-castResult.Distance), params)
- else
- return castResult
- end
- end
- local function Use(...)
- local args = {...}
- local character = args[1].Character
- local root = character.Torso
- local humanoid = character.Humanoid
- local windmill = initWindmill:Clone()
- local wmLower, wmUpper = windmill.Lower, windmill.Upper
- wmLower.Anchored, wmLower.CanCollide, wmLower.Massless, wmUpper.Anchored, wmUpper.CanCollide, wmUpper.Massless =
- false, false, true, false, false, true
- wmLower.CFrame, wmUpper.CFrame = root.CFrame*CFrame.new(0, -0.7, -8), root.CFrame*CFrame.new(0, 1.605, -8)
- windmill.Parent=workspace
- local wmWeld = Instance.new("Weld")
- wmWeld.Part0, wmWeld.Part1, wmWeld.C0, wmWeld.Name =
- root, wmLower, CFrame.new(0, -0.7, -8), "Weld"
- wmWeld.Parent = wmLower
- wmWeld = Instance.new("Weld")
- wmWeld.Part0, wmWeld.Part1, wmWeld.C0, wmWeld.Name =
- root, wmUpper, CFrame.new(0, 1.605, -8.203), "Weld"
- wmWeld.Parent = wmUpper
- task.wait(windup)
- wmLower.Anchored, wmLower.CanCollide, wmUpper.Massless, wmUpper.CanCollide = true, true, false, true
- local wmMass = wmUpper:GetMass()
- if wmLower:FindFirstChild("Weld") and wmUpper:FindFirstChild("Weld") then
- wmLower.Weld:Destroy()
- wmUpper.Weld:Destroy()
- wmUpper:ApplyImpulse(Vector3.new(wmMass*math.random(-20, 20), wmMass*math.random(50, 80), wmMass*math.random(-20, 0)))
- wmUpper:ApplyAngularImpulse(Vector3.new(wmMass*math.random(-360, 360), wmMass*math.random(-360, 360), wmMass*math.random(-360, 360)))
- coroutine.wrap(function()
- task.wait(windmillDespawnTimer)
- wmUpper:Destroy()
- wmLower:Destroy()
- end)()
- else
- wmUpper:Destroy()
- wmLower:Destroy()
- end
- task.wait(0.1)
- local plrSaveCF = root.CFrame
- local targetParams = RaycastParams.new()
- targetParams.CollisionGroup, targetParams.FilterType, targetParams.FilterDescendantsInstances = "Default", Enum.RaycastFilterType.Exclude, {character, windmill}
- local targetCast = Raycast(root.Position, plrSaveCF.lookVector*dashDistance, targetParams)
- local targetHit = targetCast and targetCast.Position or (plrSaveCF*CFrame.new(0, 0, -dashDistance)).Position
- root.CFrame=CFrame.lookAt(targetHit, targetHit+plrSaveCF.lookVector)
- local midpoint = (targetHit+plrSaveCF.Position)/2
- local dist = (targetHit-plrSaveCF.Position).Magnitude
- local innerTrail = Instance.new("Part")
- innerTrail.Anchored, innerTrail.CanCollide, innerTrail.Material, innerTrail.Size, innerTrail.CFrame, innerTrail.Color, innerTrail.Transparency =
- true, false, "Neon", Vector3.new(0.5, 0.5, dist), CFrame.lookAt(midpoint, targetHit), innerDashColor, innerDashTrans
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshType = Enum.MeshType.Sphere
- mesh.Parent = innerTrail
- innerTrail.Parent = workspace
- local outerTrail = Instance.new("Part")
- outerTrail.Anchored, outerTrail.CanCollide, outerTrail.Material, outerTrail.Size, outerTrail.CFrame, outerTrail.Color, outerTrail.Transparency =
- true, false, "Neon", Vector3.new(1.5, 1.5, dist+1), CFrame.lookAt(midpoint, targetHit), outerDashColor, outerDashTrans
- mesh = Instance.new("SpecialMesh")
- mesh.MeshType = Enum.MeshType.Sphere
- mesh.Parent = outerTrail
- local sparkles = Instance.new("ParticleEmitter")
- sparkles.Color, sparkles.Lifetime, sparkles.Rate, sparkles.SpreadAngle, sparkles.Speed =
- ColorSequence.new(innerDashColor), NumberRange.new(0.5, 0.8), 0, Vector2.new(360, 360), NumberRange.new(8, 12)
- sparkles.Parent = outerTrail
- outerTrail.Parent = workspace
- local slashHitbox = Instance.new("Part")
- slashHitbox.CanCollide, slashHitbox.Transparency, slashHitbox.Size, slashHitbox.CFrame =
- false, 1, Vector3.new(hitboxWidth, hitboxHeight, dist), CFrame.lookAt(midpoint, targetHit)
- slashHitbox.Parent = workspace
- local startHitbox = Instance.new("Part")
- startHitbox.CanCollide, startHitbox.Transparency, startHitbox.Shape, startHitbox.Size, startHitbox.Position =
- false, 1, Enum.PartType.Ball, Vector3.new(hitboxSphere, hitboxSphere, hitboxSphere), plrSaveCF.Position
- startHitbox.Parent = workspace
- local endHitbox = Instance.new("Part")
- endHitbox.CanCollide, endHitbox.Transparency, endHitbox.Shape, endHitbox.Size, endHitbox.Position =
- false, 1, Enum.PartType.Ball, Vector3.new(hitboxSphere, hitboxSphere, hitboxSphere), targetHit
- endHitbox.Parent = workspace
- local hbBodyV = Instance.new("BodyVelocity")
- hbBodyV.Velocity, hbBodyV.MaxForce = Vector3.new(0, 0.1, 0), Vector3.new(math.huge, math.huge, math.huge)
- hbBodyV.Parent = slashHitbox
- hbBodyV = Instance.new("BodyVelocity")
- hbBodyV.Velocity, hbBodyV.MaxForce = Vector3.new(0, 0.1, 0), Vector3.new(math.huge, math.huge, math.huge)
- hbBodyV.Parent = startHitbox
- hbBodyV = Instance.new("BodyVelocity")
- hbBodyV.Velocity, hbBodyV.MaxForce = Vector3.new(0, 0.1, 0), Vector3.new(math.huge, math.huge, math.huge)
- hbBodyV.Parent = endHitbox
- DamageService:RegisterWeaponPart(args[1], {slashHitbox, startHitbox, endHitbox, outerTrail}, DMG)
- coroutine.wrap(function() -- I much prefer this approach to maintain sync between the two trails
- local inInc, outInc, sizeInc = (1-innerDashTrans)/40, (1-outerDashTrans)/40, Vector3.new(1/40, 1/40, 0)
- task.wait(0.1)
- sparkles:Emit(18)
- for i=1,40 do
- innerTrail.Transparency+=inInc
- innerTrail.Size+=sizeInc
- outerTrail.Transparency+=outInc
- outerTrail.Size+=sizeInc
- task.wait(1/60)
- if i==5 then slashHitbox:Destroy() startHitbox:Destroy() endHitbox:Destroy() end
- end
- innerTrail:Destroy() outerTrail:Destroy() sparkles:Destroy()
- end)()
- end
- return Use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement