I want to make my final punch of my m1 combo to be a strong punch that knockbacks and ragdolls the enemy, then the enemy gets up 1 or two seconds later.
if Count ~= nil then
FrameWork.Sound(game.ReplicatedStorage.Sounds.Hit:WaitForChild("Punch"..Count),{Parent = EnemyChar.HumanoidRootPart},2)
if EnemyChar:FindFirstChild("Humanoid") ~= nil and EnemyChar.Humanoid.Health > 0 and EnemyChar:FindFirstChild("HumanoidRootPart") ~= nil and MainChar:FindFirstChild("HumanoidRootPart") ~= nil then
FrameWork.Animation(game.ReplicatedStorage.Animations.Hit:WaitForChild("Recoil"..Count),EnemyChar.Humanoid)
if EnemyChar:FindFirstChild("Blocking") == nil then
EnemyChar.HumanoidRootPart.CFrame = CFrame.new(EnemyChar.HumanoidRootPart.Position,MainChar.HumanoidRootPart.Position)
end
if Count < 5 then
FrameWork.CreateTing("BodyVelocity",{Parent = EnemyChar.HumanoidRootPart,MaxForce = Vector3.new(4e4,0,4e4),Velocity = MainChar.HumanoidRootPart.CFrame.LookVector * 30},.05)
elseif Count == 5 then
FrameWork.CreateTing("BodyVelocity",{Parent = EnemyChar.HumanoidRootPart,MaxForce = Vector3.new(4e4,0,4e4),Velocity = MainChar.HumanoidRootPart.CFrame.LookVector * 50},.2)
-- the part where i want it to ragdoll and get back up a second or two later (Knockback is already the bodyvelocity)
end
end
if game.Players:FindFirstChild(MainChar.Name) ~= nil and game.ReplicatedStorage.PlayersData:FindFirstChild(MainChar.Name.."Data") ~= nil and game.ReplicatedStorage.PlayersData[MainChar.Name.."Data"]:FindFirstChild("Hit") ~= nil then
game.ReplicatedStorage.PlayersData[MainChar.Name.."Data"].Hit.Value += 1
end
EnemyChar.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
if EnemyChar:FindFirstChild("Humanoid") ~= nil and EnemyChar.Humanoid.Health > 0 and EnemyChar:FindFirstChild("HumanoidRootPart") ~= nil and MainChar:FindFirstChild("HumanoidRootPart") ~= nil then
local HitEffect = game.ReplicatedStorage.Effects.HitEffect:WaitForChild("HitEffect"):Clone()
HitEffect.Parent = EnemyChar.HumanoidRootPart
_G.Debris(HitEffect,2)
for i,v in pairs(HitEffect:GetChildren()) do
if v:IsA("ParticleEmitter") then
v:Emit(v:GetAttribute("EmitCount"))
end
end
end
You can see I put a comment statement in the script so you will know.
How would I make a Knockback Ragdoll?