Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local Workspace = game:GetService("Workspace")
- local SoundService = game:GetService("SoundService")
- local ApplyKnockback = require(ReplicatedStorage:WaitForChild("Modules"):WaitForChild("ApplyKnockBack"))
- local ApplyDamage = require(ReplicatedStorage:WaitForChild("Modules"):WaitForChild("ApplyDamage"))
- local StunModule = require(ReplicatedStorage:WaitForChild("Modules"):WaitForChild("StunModule"))
- local RocksModule = require(ReplicatedStorage:WaitForChild("Modules"):WaitForChild("RocksModule"))
- local HitboxModule = require(ReplicatedStorage:WaitForChild("Modules"):WaitForChild("HitboxModule"))
- local CharModule = require(ReplicatedStorage:WaitForChild("Modules"):WaitForChild("CharacterModule"):WaitForChild("Characters"):WaitForChild("Sword Master"))
- local Remotes = ReplicatedStorage:WaitForChild("Remotes")
- local function ApplyHitEffects(Target: Model, Player: Player, Damage: number, HitNumber: number)
- if HitNumber < 3 then
- local HitDamage = Damage * 0.25
- ApplyDamage.ApplyDamage(Player, Target, HitDamage)
- StunModule.StunFor(Target, 2)
- else
- local HitDamage = Damage * 0.5
- ApplyDamage.ApplyDamage(Player, Target, HitDamage)
- local Knockback = ApplyKnockback.new(Target, Player.Character, 5, 5)
- Knockback:Construct()
- end
- end
- return function(Player: Player, AbilityData)
- local Name = AbilityData.Name
- local Damage = AbilityData.Damage
- local Cooldown = AbilityData.Cooldown
- local Hitbox = AbilityData.Hitbox
- local HitboxDelay = AbilityData.HitboxDelay
- local Animation = AbilityData.Animation
- local Character = Player.Character
- local HRP: BasePart = Character:FindFirstChild("HumanoidRootPart")
- local Humanoid: Humanoid = Character:FindFirstChild("Humanoid")
- local OriginalWS = Humanoid.WalkSpeed
- Humanoid.WalkSpeed = 0
- task.delay(0.5, function()
- local HitPosition = Character.PrimaryPart.Position
- local Anim = Instance.new("Animation")
- Anim.AnimationId = `rbxassetid://{Animation}`
- local AnimTrack = Humanoid:FindFirstChildOfClass("Animator"):LoadAnimation(Anim)
- for HitNumber = 1, 3 do
- AnimTrack:Play()
- AnimTrack.Stopped:Wait()
- local StoneSize = Vector3.new(3, 3, 3)
- local StoneAmount = 8
- local Radius = 15
- if HitNumber == 1 then
- StoneSize = Vector3.new(2, 2, 2)
- Radius = 5
- local StoneAmount = 4
- elseif HitNumber == 2 then
- StoneSize = Vector3.new(2, 2, 2)
- Radius = 10
- local StoneAmount = 6
- end
- Remotes.CamShake:FireClient(Player, "SmallExplosion")
- Remotes.PlaySound:FireClient(Player, "Earthsplitter", HRP)
- RocksModule.Ground(HitPosition, Radius, StoneSize, {Player.Character, Workspace.Dummys.Blocking, Workspace.Dummys.Dummy}, 8, false, 5)
- for _, Enemy in pairs(Workspace:GetChildren()) do
- if Enemy:IsA("Model") and Enemy:FindFirstChildOfClass("Humanoid") then
- local Distance = (Enemy.PrimaryPart.Position - HitPosition).Magnitude
- if Distance <= Radius and Enemy ~= Player.Character then
- ApplyHitEffects(Enemy, Player, Damage, HitNumber)
- end
- end
- end
- for _, Dummy in pairs(Workspace.Dummys:GetChildren()) do
- if Dummy:IsA("Model") and Dummy:FindFirstChildOfClass("Humanoid") then
- local Distance = (Dummy.PrimaryPart.Position - HitPosition).Magnitude
- if Distance <= Radius then
- ApplyHitEffects(Dummy, Player, Damage, HitNumber)
- end
- end
- end
- end
- end)
- Humanoid.WalkSpeed = OriginalWS
- end
Advertisement
Add Comment
Please, Sign In to add comment