Hey guys, I have a new problem. The knockback works fine with player attacking NPC’s but NPC attacking player don’t work, they are the same numbers
KickForce is 300
KickUpforce is 600
Npc’s script
player.RagdollTrigger.Value = true
coroutine.wrap(function()
task.wait(ragdollTime)
player.RagdollTrigger.Value = false
end)()
local forceToApply = KickForce
local upforce = KickUpforce
player.HumanoidRootPart:ApplyImpulse(NPC.HumanoidRootPart.CFrame.LookVector*forceToApply +Vector3.new(0,upforce,0))
player’s script
local forceToApply = KickForce
local upforce = KickUpforce
humanoid.Parent.HumanoidRootPart:SetNetworkOwner(nil)
humanoid.Parent.HumanoidRootPart:ApplyImpulse(player.Character.HumanoidRootPart.CFrame.LookVector*forceToApply +Vector3.new(0,upforce,0))
coroutine.wrap(function()
repeat task.wait() until humanoid.Parent:GetAttribute("Stunned") == false
humanoid.Parent.HumanoidRootPart:SetNetworkOwnershipAuto()
end)()
humanoid.Parent.RagdollTrigger.Value = true
coroutine.wrap(function()
task.wait(ragdollTime)
humanoid.Parent.RagdollTrigger.Value = false
end)()