Knockback and ragdoll

External Media

for some reason sometimes when the character gets knockback, the player ragdolls but doesnt get knockedback

Script that knockbacks:

Funcations.Knockback = function(char,Target,Stat,CustomAOE)
	Target.Torso:SetNetworkOwner(nil)
	Target.Torso.AssemblyLinearVelocity = char.HumanoidRootPart.CFrame.lookVector * Stat["HITBOX"]["KNOCKBACK"][1] or 50
	task.spawn(function()
		task.wait(.05)
		Target.Torso:SetNetworkOwner(char)
	end)
	if Stat["HITBOX"]["KNOCKBACK"][2] == true then
		Funcations.Ragdoll(Target)
	end
end

Part calling ragdoll module:

Funcations.Ragdoll = function(char,Stat)
	if char:FindFirstChild("Ragdolled") then
		return
	end
	task.spawn(function()
		Funcations.CreateValue(char,"Ragdolled","StringValue",1,1)

		task.spawn(function()
			RagdollModule:RigPlayer(char)
			local s = tick()
			repeat
				char.Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
				wait()
			until not char:FindFirstChild("Ragdolled")
			char.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
		end)
	end)
end