Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local PunchRemote = ReplicatedStorage.Remotes.Punching
- local BlockRemote = ReplicatedStorage.Remotes.Blocking
- local M2Remote = ReplicatedStorage.Remotes.M2Remote
- ----- Folders
- local AnimationsFolder = script:WaitForChild("Animations")
- local PlayerAnimations = AnimationsFolder:WaitForChild("Player")
- local EnemyAnimations = AnimationsFolder:WaitForChild("Enemy")
- local SoundFolder = script:WaitForChild("Sounds")
- ------ Player Animations
- local Punch1 = PlayerAnimations:WaitForChild("RightPunch")
- local Punch2 = PlayerAnimations:WaitForChild("LeftPunch")
- local Punch3 = PlayerAnimations:WaitForChild("RightPunch1")
- local Punch4 = PlayerAnimations:WaitForChild("LeftPunch1")
- local Punch5 = PlayerAnimations:WaitForChild("Final")
- ---- Enemy Animations
- local LeftHit = EnemyAnimations:WaitForChild("LeftHit")
- local KnockBack = EnemyAnimations:WaitForChild("KnockBack")
- local RightHit = EnemyAnimations:WaitForChild("RightHit")
- local Blocked = EnemyAnimations:WaitForChild("Blocked")
- local Break = EnemyAnimations:WaitForChild("Break")
- --- Sounds
- local PunchSwing = SoundFolder:WaitForChild("SwingFist")
- local HitSound = SoundFolder:WaitForChild("Hit")
- local BlockSound = SoundFolder:WaitForChild("BlockedSound")
- local Heavy = SoundFolder:WaitForChild("Heavy")
- local BlockBreakSound = SoundFolder:WaitForChild("BlockBreak")
- --- Booleans
- local CanHit = true
- local Equipped = false
- ---- effects
- local Effects = script:WaitForChild("Effects")
- local HitEffect = Effects:WaitForChild("HitEffect")
- local AttachmentHit = HitEffect.Attachment
- local BlockEffect = Effects:WaitForChild("BlockEffect")
- local AttachmentBlock = BlockEffect.Attachment
- local breakEffect = Effects:WaitForChild("BreakEffect")
- local AttachmentBreak = breakEffect.Attachment
- local Shake = script:WaitForChild("ShakeScript")
- -- Billboards
- local StunnedGui = script:WaitForChild("Stunned")
- local ParryGui = script:WaitForChild("Parry")
- local blockAnimationId = "rbxassetid://14358636029"
- ------- Configurations
- local BasicDamage = 5
- local FinalDamage = 8
- local BasicStun = .5
- local FinalStun = 1
- local ParriedDebounce = true
- PunchRemote.OnServerEvent:Connect(function(player, Combo)
- print("Fired")
- local Character = player.Character
- local Humanoid = Character:WaitForChild("Humanoid")
- local PlayerParriedCount = Character:FindFirstChild("ParriedCount")
- if Combo == 1 then ---- the first Punch
- CanHit = true
- -- sound
- local Swingy = PunchSwing:Clone()
- Swingy.Parent = Character.HumanoidRootPart
- Swingy:Play()
- game.Debris:AddItem(Swingy,2)
- ---- animation
- print("Combo Recieved")
- local anim = Humanoid:LoadAnimation(Punch1)
- anim:Play()
- ------- hit box instance
- local hitbox = Instance.new("Part", Character)
- hitbox.Anchored = false
- hitbox.CanCollide = false
- hitbox.Size = Character.HumanoidRootPart.Size
- hitbox.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, -2.5)
- hitbox.Transparency = 1
- local hitboxWeld = Instance.new("ManualWeld")
- hitboxWeld.Name = "HitboxWeld"
- hitboxWeld.Part0 = hitbox
- hitboxWeld.Part1 = Character.HumanoidRootPart
- hitboxWeld.C0 = hitbox.CFrame:ToObjectSpace(Character.HumanoidRootPart.CFrame)
- hitboxWeld.Parent = hitbox
- ---- HitBox touched
- hitbox.Touched:Connect(function(hit)
- if CanHit == false then return end
- if hit.Parent:FindFirstChild("Humanoid") then
- local Parry = hit.Parent:FindFirstChild("Parry")
- if Parry.Value == true then
- coroutine.wrap(function()
- if ParriedDebounce then
- ParriedDebounce = false
- PlayerParriedCount.Value = PlayerParriedCount.Value + 1
- wait(1.5)
- ParriedDebounce = true
- end
- end)()
- Character.Stunned.Value = true
- Humanoid.WalkSpeed = 0
- local ui = ParryGui:Clone()
- ui.Parent = Character.Head
- game.Debris:AddItem(ui,BasicStun)
- wait(BasicStun)
- Character.Stunned.Value = false
- Humanoid.WalkSpeed = 16
- end
- if not hit:IsDescendantOf(Character) then
- if Parry.Value == true then return end
- if hit.Parent.Blocking.Value == false then
- CanHit = false
- local enemyHum = hit.Parent:FindFirstChild("Humanoid")
- enemyHum:TakeDamage(BasicDamage)
- local HitAnimation = enemyHum:LoadAnimation(LeftHit)
- HitAnimation:Play()
- local Hitty = HitSound:Clone()
- Hitty.Parent = Character.HumanoidRootPart
- Hitty:Play()
- game.Debris:AddItem(Hitty,2)
- local hitToCharacterDir = (Character.HumanoidRootPart.Position - hit.Parent.HumanoidRootPart.Position).unit
- local Atttachy = AttachmentHit:Clone()
- Atttachy.Parent = hit.Parent.HumanoidRootPart
- Atttachy.Ring:Emit(1)
- Atttachy.Sparks:Emit(20)
- Atttachy.Residue:Emit(20)
- Atttachy.CenterSpark:Emit(1)
- game.Debris:AddItem(Atttachy,2)
- hit.Parent.Stunned.Value = true
- enemyHum.WalkSpeed = 0
- local ui = StunnedGui:Clone()
- ui.Parent = hit.Parent.Head
- game.Debris:AddItem(ui,BasicStun)
- CanHit = false
- hitbox:Destroy()
- wait(BasicStun)
- hit.Parent.Stunned.Value = false
- enemyHum.WalkSpeed = 16
- else
- local Hitty = BlockSound:Clone()
- Hitty.Parent = Character.HumanoidRootPart
- Hitty:Play()
- game.Debris:AddItem(Hitty,2)
- CanHit = false
- print("Blocking")
- local enemyHum = hit.Parent:FindFirstChild("Humanoid")
- local HitAnimation = enemyHum:LoadAnimation(Blocked)
- HitAnimation:Play()
- local Atttachy = AttachmentBlock:Clone()
- Atttachy.Parent = hit.Parent.HumanoidRootPart
- Atttachy.Radial:Emit(1)
- Atttachy.CenterStar:Emit(30)
- Atttachy.Sparks:Emit(30)
- game.Debris:AddItem(Atttachy,2)
- -- Apply BodyVelocity to push the player
- local vel = Instance.new("BodyVelocity")
- vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- vel.Parent = hit.Parent.HumanoidRootPart
- vel.Velocity = hit.Parent.HumanoidRootPart.CFrame.LookVector * -2
- vel.Name = "SmallMoveVel"
- game.Debris:AddItem(vel,.7)
- end
- end
- end
- end)
- wait(.5)
- hitbox:Destroy()
- end -- last end for Combo == 1
- if Combo == 2 then ---- the second Punch
- CanHit = true
- -- sound
- local Swingy = PunchSwing:Clone()
- Swingy.Parent = Character.HumanoidRootPart
- Swingy:Play()
- game.Debris:AddItem(Swingy,2)
- ---- animation
- print("Combo Recieved")
- local anim = Humanoid:LoadAnimation(Punch2)
- anim:Play()
- ------- hit box instance
- local hitbox = Instance.new("Part", Character)
- hitbox.Anchored = false
- hitbox.CanCollide = false
- hitbox.Size = Character.HumanoidRootPart.Size
- hitbox.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, -2.5)
- hitbox.Transparency = 1
- local hitboxWeld = Instance.new("ManualWeld")
- hitboxWeld.Name = "HitboxWeld"
- hitboxWeld.Part0 = hitbox
- hitboxWeld.Part1 = Character.HumanoidRootPart
- hitboxWeld.C0 = hitbox.CFrame:ToObjectSpace(Character.HumanoidRootPart.CFrame)
- hitboxWeld.Parent = hitbox
- ---- HitBox touched
- hitbox.Touched:Connect(function(hit)
- if CanHit == false then return end
- if hit.Parent:FindFirstChild("Humanoid") then
- local Parry = hit.Parent:FindFirstChild("Parry")
- if Parry.Value == true then
- hit.Parent.Stunned.Value = true
- Humanoid.WalkSpeed = 0
- local ui = ParryGui:Clone()
- ui.Parent = Character.Head
- game.Debris:AddItem(ui,BasicStun)
- wait(BasicStun)
- hit.Parent.Stunned.Value = false
- Humanoid.WalkSpeed = 16
- end
- if not hit:IsDescendantOf(Character) then
- if Parry.Value == true then return end
- if hit.Parent.Blocking.Value == false then
- CanHit = false
- local enemyHum = hit.Parent:FindFirstChild("Humanoid")
- enemyHum:TakeDamage(BasicDamage)
- local HitAnimation = enemyHum:LoadAnimation(RightHit)
- HitAnimation:Play()
- local Hitty = HitSound:Clone()
- Hitty.Parent = Character.HumanoidRootPart
- Hitty:Play()
- game.Debris:AddItem(Hitty,2)
- local Atttachy = AttachmentHit:Clone()
- Atttachy.Parent = hit.Parent.HumanoidRootPart
- Atttachy.Ring:Emit(1)
- Atttachy.Sparks:Emit(20)
- Atttachy.Residue:Emit(20)
- Atttachy.CenterSpark:Emit(1)
- hit.Parent.Stunned.Value = true
- enemyHum.WalkSpeed = 0
- game.Debris:AddItem(Atttachy,2)
- local ui = StunnedGui:Clone()
- ui.Parent = hit.Parent.Head
- game.Debris:AddItem(ui,BasicStun)
- CanHit = false
- hitbox:Destroy()
- wait(BasicStun)
- hit.Parent.Stunned.Value = false
- enemyHum.WalkSpeed = 16
- else
- local Hitty = BlockSound:Clone()
- Hitty.Parent = Character.HumanoidRootPart
- Hitty:Play()
- game.Debris:AddItem(Hitty,2)
- CanHit = false
- print("Blocking")
- local enemyHum = hit.Parent:FindFirstChild("Humanoid")
- local HitAnimation = enemyHum:LoadAnimation(Blocked)
- HitAnimation:Play()
- local Atttachy = AttachmentBlock:Clone()
- Atttachy.Parent = hit.Parent.HumanoidRootPart
- Atttachy.Radial:Emit(1)
- Atttachy.CenterStar:Emit(30)
- Atttachy.Sparks:Emit(30)
- game.Debris:AddItem(Atttachy,2)
- -- Apply BodyVelocity to push the player
- local vel = Instance.new("BodyVelocity")
- vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- vel.Parent = hit.Parent.HumanoidRootPart
- vel.Velocity = hit.Parent.HumanoidRootPart.CFrame.LookVector * -2
- vel.Name = "SmallMoveVel"
- game.Debris:AddItem(vel,.7)
- end
- end
- end
- end)
- wait(.5)
- hitbox:Destroy()
- end -- last end for Combo == 2
- if Combo == 3 then ---- the third Punch
- CanHit = true
- -- sound
- local Swingy = PunchSwing:Clone()
- Swingy.Parent = Character.HumanoidRootPart
- Swingy:Play()
- game.Debris:AddItem(Swingy,2)
- ---- animation
- print("Combo Recieved")
- local anim = Humanoid:LoadAnimation(Punch3)
- anim:Play()
- ------- hit box instance
- local hitbox = Instance.new("Part", Character)
- hitbox.Anchored = false
- hitbox.CanCollide = false
- hitbox.Size = Character.HumanoidRootPart.Size
- hitbox.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, -2.5)
- hitbox.Transparency = 1
- local hitboxWeld = Instance.new("ManualWeld")
- hitboxWeld.Name = "HitboxWeld"
- hitboxWeld.Part0 = hitbox
- hitboxWeld.Part1 = Character.HumanoidRootPart
- hitboxWeld.C0 = hitbox.CFrame:ToObjectSpace(Character.HumanoidRootPart.CFrame)
- hitboxWeld.Parent = hitbox
- ---- HitBox touched
- hitbox.Touched:Connect(function(hit)
- if CanHit == false then return end
- local Parry = hit.Parent:FindFirstChild("Parry")
- if Parry.Value == true then
- hit.Parent.Stunned.Value = true
- Humanoid.WalkSpeed = 0
- local ui = ParryGui:Clone()
- ui.Parent = Character.Head
- game.Debris:AddItem(ui,BasicStun)
- wait(BasicStun)
- hit.Parent.Stunned.Value = false
- Humanoid.WalkSpeed = 16
- end
- if hit.Parent:FindFirstChild("Humanoid") then
- if Parry.Value == true then return end
- if not hit:IsDescendantOf(Character) then
- if hit.Parent.Blocking.Value == false then
- CanHit = false
- local enemyHum = hit.Parent:FindFirstChild("Humanoid")
- enemyHum:TakeDamage(BasicDamage)
- local HitAnimation = enemyHum:LoadAnimation(LeftHit)
- HitAnimation:Play()
- local Hitty = HitSound:Clone()
- Hitty.Parent = Character.HumanoidRootPart
- Hitty:Play()
- game.Debris:AddItem(Hitty,2)
- local Atttachy = AttachmentHit:Clone()
- Atttachy.Parent = hit.Parent.HumanoidRootPart
- Atttachy.Ring:Emit(1)
- Atttachy.Sparks:Emit(20)
- Atttachy.Residue:Emit(20)
- Atttachy.CenterSpark:Emit(1)
- hit.Parent.Stunned.Value = true
- enemyHum.WalkSpeed = 0
- game.Debris:AddItem(Atttachy,2)
- local ui = StunnedGui:Clone()
- ui.Parent = hit.Parent.Head
- game.Debris:AddItem(ui,BasicStun)
- CanHit = false
- hitbox:Destroy()
- wait(BasicStun)
- hit.Parent.Stunned.Value = false
- enemyHum.WalkSpeed = 16
- else
- local Hitty = BlockSound:Clone()
- Hitty.Parent = Character.HumanoidRootPart
- Hitty:Play()
- game.Debris:AddItem(Hitty,2)
- CanHit = false
- print("Blocking")
- local enemyHum = hit.Parent:FindFirstChild("Humanoid")
- local HitAnimation = enemyHum:LoadAnimation(Blocked)
- HitAnimation:Play()
- local Atttachy = AttachmentBlock:Clone()
- Atttachy.Parent = hit.Parent.HumanoidRootPart
- Atttachy.Radial:Emit(1)
- Atttachy.CenterStar:Emit(30)
- Atttachy.Sparks:Emit(30)
- game.Debris:AddItem(Atttachy,2)
- -- Apply BodyVelocity to push the player
- local vel = Instance.new("BodyVelocity")
- vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- vel.Parent = hit.Parent.HumanoidRootPart
- vel.Velocity = hit.Parent.HumanoidRootPart.CFrame.LookVector * -2
- vel.Name = "SmallMoveVel"
- game.Debris:AddItem(vel,.7)
- end
- end
- end
- end)
- wait(.5)
- hitbox:Destroy()
- end -- last end for Combo == 2
- if Combo == 4 then ---- the fourth Punch
- CanHit = true
- -- sound
- local Swingy = PunchSwing:Clone()
- Swingy.Parent = Character.HumanoidRootPart
- Swingy:Play()
- game.Debris:AddItem(Swingy,2)
- ---- animation
- print("Combo Recieved")
- local anim = Humanoid:LoadAnimation(Punch4)
- anim:Play()
- ------- hit box instance
- local hitbox = Instance.new("Part", Character)
- hitbox.Anchored = false
- hitbox.CanCollide = false
- hitbox.Size = Character.HumanoidRootPart.Size
- hitbox.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, -2.5)
- hitbox.Transparency = 1
- local hitboxWeld = Instance.new("ManualWeld")
- hitboxWeld.Name = "HitboxWeld"
- hitboxWeld.Part0 = hitbox
- hitboxWeld.Part1 = Character.HumanoidRootPart
- hitboxWeld.C0 = hitbox.CFrame:ToObjectSpace(Character.HumanoidRootPart.CFrame)
- hitboxWeld.Parent = hitbox
- ---- HitBox touched
- hitbox.Touched:Connect(function(hit)
- if CanHit == false then return end
- local Parry = hit.Parent:FindFirstChild("Parry")
- if Parry.Value == true then
- hit.Parent.Stunned.Value = true
- Humanoid.WalkSpeed = 0
- local ui = ParryGui:Clone()
- ui.Parent = Character.Head
- game.Debris:AddItem(ui,BasicStun)
- wait(BasicStun)
- hit.Parent.Stunned.Value = false
- Humanoid.WalkSpeed = 16
- end
- if hit.Parent:FindFirstChild("Humanoid") then
- if Parry.Value == true then return end
- if not hit:IsDescendantOf(Character) then
- if hit.Parent.Blocking.Value == false then
- CanHit = false
- local enemyHum = hit.Parent:FindFirstChild("Humanoid")
- enemyHum:TakeDamage(BasicDamage)
- local HitAnimation = enemyHum:LoadAnimation(RightHit)
- HitAnimation:Play()
- local Hitty = HitSound:Clone()
- Hitty.Parent = Character.HumanoidRootPart
- Hitty:Play()
- game.Debris:AddItem(Hitty,2)
- hit.Parent.Stunned.Value = true
- enemyHum.WalkSpeed = 0
- local Atttachy = AttachmentHit:Clone()
- Atttachy.Parent = hit.Parent.HumanoidRootPart
- Atttachy.Ring:Emit(1)
- Atttachy.Sparks:Emit(20)
- Atttachy.Residue:Emit(20)
- Atttachy.CenterSpark:Emit(1)
- game.Debris:AddItem(Atttachy,2)
- local ui = StunnedGui:Clone()
- ui.Parent = hit.Parent.Head
- game.Debris:AddItem(ui,BasicStun)
- CanHit = false
- hitbox:Destroy()
- wait(BasicStun)
- hit.Parent.Stunned.Value = false
- enemyHum.WalkSpeed = 16
- else
- local Hitty = BlockSound:Clone()
- Hitty.Parent = Character.HumanoidRootPart
- Hitty:Play()
- game.Debris:AddItem(Hitty,2)
- CanHit = false
- print("Blocking")
- local enemyHum = hit.Parent:FindFirstChild("Humanoid")
- local HitAnimation = enemyHum:LoadAnimation(Blocked)
- HitAnimation:Play()
- local Atttachy = AttachmentBlock:Clone()
- Atttachy.Parent = hit.Parent.HumanoidRootPart
- Atttachy.Radial:Emit(1)
- Atttachy.CenterStar:Emit(30)
- Atttachy.Sparks:Emit(30)
- game.Debris:AddItem(Atttachy,2)
- -- Apply BodyVelocity to push the player
- local vel = Instance.new("BodyVelocity")
- vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- vel.Parent = hit.Parent.HumanoidRootPart
- vel.Velocity = hit.Parent.HumanoidRootPart.CFrame.LookVector * -2
- vel.Name = "SmallMoveVel"
- game.Debris:AddItem(vel,.7)
- end
- end
- end
- end)
- wait(.5)
- hitbox:Destroy()
- end -- last end for Combo == 4
- if Combo == 5 then ---- the final Punch
- CanHit = true
- -- sound
- local Swingy = PunchSwing:Clone()
- Swingy.Parent = Character.HumanoidRootPart
- Swingy:Play()
- game.Debris:AddItem(Swingy,2)
- ---- animation
- print("Combo Recieved")
- local anim = Humanoid:LoadAnimation(Punch5)
- anim:Play()
- ------- hit box instance
- local hitbox = Instance.new("Part", Character)
- hitbox.Anchored = false
- hitbox.CanCollide = false
- hitbox.Size = Character.HumanoidRootPart.Size
- hitbox.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, -2.5)
- hitbox.Transparency = 1
- local hitboxWeld = Instance.new("ManualWeld")
- hitboxWeld.Name = "HitboxWeld"
- hitboxWeld.Part0 = hitbox
- hitboxWeld.Part1 = Character.HumanoidRootPart
- hitboxWeld.C0 = hitbox.CFrame:ToObjectSpace(Character.HumanoidRootPart.CFrame)
- hitboxWeld.Parent = hitbox
- ---- HitBox touched
- hitbox.Touched:Connect(function(hit)
- if CanHit == false then return end
- local Parry = hit.Parent:FindFirstChild("Parry")
- if Parry.Value == true then
- hit.Parent.Stunned.Value = true
- Humanoid.WalkSpeed = 0
- local ui = ParryGui:Clone()
- ui.Parent = Character.Head
- game.Debris:AddItem(ui,BasicStun)
- wait(BasicStun)
- hit.Parent.Stunned.Value = false
- Humanoid.WalkSpeed = 16
- end
- if hit.Parent:FindFirstChild("Humanoid") then
- if Parry.Value == true then return end
- if not hit:IsDescendantOf(Character) then
- if hit.Parent.Blocking.Value == false then
- CanHit = false
- local enemyHum = hit.Parent:FindFirstChild("Humanoid")
- enemyHum:TakeDamage(FinalDamage)
- local HitAnimation = enemyHum:LoadAnimation(KnockBack)
- HitAnimation:Play()
- local Shakes = Shake:Clone()
- Shakes.Parent = Character
- Shakes.Disabled = false
- game.Debris:AddItem(Shakes,.55)
- local Hitty = Heavy:Clone()
- Hitty.Parent = Character.HumanoidRootPart
- Hitty:Play()
- game.Debris:AddItem(Hitty,2)
- hit.Parent.Stunned.Value = true
- enemyHum.WalkSpeed = 0
- local Atttachy = AttachmentHit:Clone()
- Atttachy.Parent = hit.Parent.HumanoidRootPart
- Atttachy.Ring:Emit(1)
- Atttachy.Sparks:Emit(20)
- Atttachy.Residue:Emit(20)
- Atttachy.CenterSpark:Emit(1)
- game.Debris:AddItem(Atttachy,2)
- -- Calculate the direction from the character's HumanoidRootPart to the hit object's HumanoidRootPart
- local hitToCharacterDir = (Character.HumanoidRootPart.Position - hit.Parent.HumanoidRootPart.Position).unit
- -- Apply BodyVelocity to push the player
- local bv = Instance.new("BodyVelocity",hit.Parent.HumanoidRootPart)
- bv.MaxForce = Vector3.new(1e8,1e8,1e8)
- bv.Velocity = hitToCharacterDir * -20 + Vector3.new(0, 2, 0)
- game.Debris:AddItem(bv,0.3)
- wait(FinalStun)
- hit.Parent.Stunned.Value = false
- enemyHum.WalkSpeed = 16
- CanHit = false
- hitbox:Destroy()
- else
- local enemyHum = hit.Parent:FindFirstChild("Humanoid")
- local Hitty = BlockBreakSound:Clone()
- Hitty.Parent = Character.HumanoidRootPart
- Hitty:Play()
- game.Debris:AddItem(Hitty,2)
- -- Retrieve the targeted player's aiming status and stop the animation if they are blocking.
- local animationTracks = enemyHum:GetPlayingAnimationTracks()
- for _, track in pairs(animationTracks) do
- if track.Animation.AnimationId == blockAnimationId then
- track:Stop()
- print("Block Anim SuccessFull Stopped")
- end
- end
- hit.Parent.Blocking.Value = false
- hit.Parent.Stunned.Value = true
- CanHit = false
- print("Block Break")
- local ui = StunnedGui:Clone()
- ui.Parent = hit.Parent.Head
- game.Debris:AddItem(ui,3)
- local enemyHum = hit.Parent:FindFirstChild("Humanoid")
- local HitAnimation = enemyHum:LoadAnimation(Break)
- HitAnimation:Play()
- local Atttachy = AttachmentBreak:Clone()
- Atttachy.Parent = hit.Parent.HumanoidRootPart
- Atttachy.Radial:Emit(1)
- Atttachy.CenterPiece:Emit(3)
- Atttachy.Sparks:Emit(30)
- Atttachy.Crack:Emit(1)
- game.Debris:AddItem(Atttachy,2)
- -- Calculate the direction from the character's HumanoidRootPart to the hit object's HumanoidRootPart
- local hitToCharacterDir = (Character.HumanoidRootPart.Position - hit.Parent.HumanoidRootPart.Position).unit
- -- Apply BodyVelocity to push the player
- local bv = Instance.new("BodyVelocity",hit.Parent.HumanoidRootPart)
- bv.MaxForce = Vector3.new(1e8,1e8,1e8)
- bv.Velocity = hitToCharacterDir * -15 + Vector3.new(0, 2, 0)
- game.Debris:AddItem(bv,0.3)
- wait(3)
- hit.Parent.Stunned.Value = false
- end
- end
- end
- end)
- wait(.5)
- hitbox:Destroy()
- end -- last end for Combo == 5
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement